Managed Object Context arrives empty when passed via a segue in iOS 5

I’ve just found that passing an NSManagedObjectContext object via a segue in iOS 5 doesn’t work: the property remains empty.

In iOS 6 on the other hand this isn’t a problem: the context arrives just like any other property would, and as logic would dictate. Here’s code from an amended Utility Template app:

Trying to execute a Fetch Request on FlipsideViewController results in this error message:

+entityForName: could not locate an NSManagedObjectModel for entity name ‘YourEntity’

The fact that this is fixed (yet completely undocumented) means that Apple knew about this and made it work in iOS 6. Why this doesn’t work in iOS 5 is anyone’s guess.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.