I am having some problems with some old code example when using it with Xcode 4.5.
In my code, I defined the following property
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
Then I have the following access method:
- (NSManagedObjectModel *)managedObjectModel { if (_managedObjectModel != nil) { return _managedObjectModel; } NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"MyPrototype" withExtension:@"momd"]; _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; return _managedObjectModel; }
The problem is that Xcode throws some errors because it cannot "see" _managedObjectModel . If I changed the name of the accessor from managedObjectModel to managedObjectModel2 , everything will be fine. I suppose the problem is with synthesizing the properties of Xcode 4.5 , but I don't know what I should do to avoid the problem. Any suggestions?
source share