I want to use the singleton UIApplication to access the managedObjectContext of the AppDelegate. But when I write
[[[UIApplication sharedApplication] delegate] managedObjectContext]
or
[[[UIApplication sharedApplication] delegate] __managedObjectContext]
it doesn't work.
But this line works fine :
NSLog(@"Seeking for the AppDelegate : %@", [[[UIApplication sharedApplication] delegate] class]);
Do you have a solution ? Niels
Try casting it to your actual app delegate implementation, like
And to add
at the top of the file.