2

Getting the exception later in the program when _managedObjectModel is being used. Below is initialiser code.

 NSURL *modelURL = [[NSBundle mainBundle] URLForResource:self.managedObjectModelName withExtension:@"momd"];
_managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];

The problem is that _managedObjectModel is pointing to a garbage memory location. After analysing GPR and assembly code i found that the ManagedObjectModel was being initialised properly but, when the content from schema is being loaded into it - the object pointer starts pointing at random locations way before the object is, or somewhere in between the object's allocated memory.

If i try to access underlying content using something like this : [_managedObjectModel->_entities allKeys], i do get all the keys in schema.

Has anyone ever faced such issues ?

This is probably something similar to https://github.com/typhoon-framework/Typhoon/issues/138

Amresh
  • 786
  • 7
  • 11
  • Have you tried looking at the (new) Typhoon+CoreData+RAC sample? https://github.com/typhoon-framework/Typhoon-CoreData-RAC-Example . . the problem linked to was closed a long time ago, Typhoon no longer has (or requires) any special treatment for Core Data. – Jasper Blues Nov 13 '14 at 07:51
  • The problem in (https://github.com/typhoon-framework/Typhoon/issues/138) was special treatment when using NSInvocation to alloc]init] NSManagedObject on ARC managed source. I completely sure this is another problem, since you didn't use NSInvocation – Aleksey Nov 14 '14 at 09:38

1 Answers1

0

self.managedObjectModelName is same as your data model name?

I guess some where here is problem in names itself.

India
  • 403
  • 2
  • 4
  • 16