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?

Konstantin.Efimenko
  • 1,242
  • 1
  • 14
  • 38

1 Answers1

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.

Tom Harrington
  • 69,312
  • 10
  • 146
  • 170