I have just updated my copy of Xcode and find that I now have lots of warnings. I am struggling to get the following one sorted out though:
ObAppDelegate *appdelegate = [[UIApplication sharedApplication]delegate];
causes this warning:
Initializing
ObAppDelegate *__strong
with an expression of incompatible typeid<UIApplicationDelegate> _Nullable
Can anyone point me in the right direction to fix this warning? For information this is the related code used prior to the problem line:
- (NSManagedObjectContext *) managedObjectContext {
return [(ObAppDelegate *) [[UIApplication sharedApplication] delegate] managedObjectContext];
}
You have:
ObAppDelegate *appdelegate = [[UIApplication sharedApplication]delegate];
This will give a warning:
Initializing
ObAppDelegate *__strong
with an expression of incompatible typeid<UIApplicationDelegate> _Nullable
Rewrite as:
ObAppDelegate *appdelegate = (ObAppDelegate*)[[UIApplication sharedApplication]delegate];
That will eliminate the warning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With