0

I try to add CoreData in my SDK project, but

NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"LSCmsModel" withExtension:@"momd"];

always returns nil. I think it connected with differences in path for SDK and project which uses this SDK. But how to resolve it?

3

1 Answer 1

1

When you call [NSBundle mainBundle], you get the app bundle. If you're developing a framework, that's not the framework bundle, so it won't find files in the framework.

Within a framework, you need to use either bundleWithIdentifier: or bundleForClass: to look up the framework bundle.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.