iphone - problems creating static library with CoreData - Cannot create an NSPersistentStoreCoordinator with a nil model -


how reference model have created in static library project?

this returns null , throws , error because resources live in static library:

     //this code in static library     - (nsmanagedobjectmodel *)managedobjectmodel {     if (__managedobjectmodel != nil) {         return __managedobjectmodel;     }      nsurl *modelurl = [[nsbundle mainbundle] urlforresource:@"ecommerceengine" withextension:@"mom"];     __managedobjectmodel = [[nsmanagedobjectmodel alloc] initwithcontentsofurl:modelurl];     return __managedobjectmodel; } 

how change pull static library?

on iphone, static libraries have .a extention , can contain code. means resources (xibs, images, etc…) must packed either in bundle or shipped separately library.

see ios library resources


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

javascript - Preserving URL fragment through CAS sign-on -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -