While trying to distribute my managedObjectContext to a view controller, I receiver that error:
Property ‘managedObjectContext’ not found on object of type ‘UIViewController *’
This code in AppDelegate.m is the origin of the error:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIViewController *searchController = [[SearchCriteriaViewController alloc] initWithNibName:@"SearchCriteriaViewController" bundle:nil];
UIViewController *managementController = [[WineManagementViewController alloc] initWithNibName:@"WineManagementViewController" bundle:nil];
managementController.managedObjectContext = self.managedObjectContext;
The code in WineManagementViewController looks like this :
@interface WineManagementViewController : UIViewController <NSFetchedResultsControllerDelegate>
{
IBOutlet UIButton *countryButton;
WineStore *store;
}
- (IBAction)newCountry:(id)sender;
@property (strong, nonatomic) UIPopoverController *poCtrl;
@property (strong, nonatomic) WineStore *store;
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
And this is the beginning of the implementation:
@implementation WineManagementViewController
@synthesize store, managedObjectContext;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
...
The property can’t be found if I want to access it in that way or if I want to access it with the setter method. Does anyone know why this property can’t be found?
Should be: