I have a Core Data object, Account
, represented as a subclass of NSManagedObject
:
@interface Account : NSManagedObject
My entire app has been developing just fine, however, when I add the MessageUI.framework
so I can get a compose email view controller, all hell breaks loose. The app links and compiles fine, and runs just fine. Until, that is, I start interfacing with my previously working Account
objects. Then, I start getting these:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: '"Account" is not a subclass of NSManagedObject.'
*** First throw call stack:
(0x202b012 ... 0x2385)
libc++abi.dylib: terminate called throwing an exception
This particular one of which was caused by:
// we need to insert a new account
Account *newAccount = [NSEntityDescription
insertNewObjectForEntityForName:[Account entityName]
inManagedObjectContext:self.managedObjectContext];
Now, I'm guessing that there is some class in the MessageUI.framework
causing the conflict, but I have a few questions:
- The app compiles and runs just fine, no compile-time name conflicts
- The other components in the framework seem to be prefix-namespaced (ie:
MFMailComposeViewController
), so should the theoretical account not beMFAccount
? - I'm not even doing an
#import <MessageUI/MessageUI.h>
or the slightly tighter#import <MessageUI/MFMailComposeViewController.h>
, the latter of which I inspected and saw no definition ofAccount
, so I'm not sure why the possible conflicts would even be loaded. - Just to be certain, I re-generated my Core Data classes, and reset all simulator settings, still no dice.
- Removing the Framework from the project and build settings immediately fixes the issue.