Observe this perfectly simple UIViewController subclass method:
-(IBAction)launchSearch
{
OffersSearchController *search = [[OffersSearchController alloc]
initWithNibName:@"OffersSearchView" bundle:nil];
EverWondrAppDelegate *del = [UIApplication sharedApplication].delegate;
[del.navigationController pushViewController:search animated:YES];
[search release];
}
On the line where I get *del, I am getting a compiler warning that reads, Type 'id <UIApplicationDelegate>' does not conform to the 'CLLocationManagerDelegate' protocol
. In fact, my app delegate DOES conform to that protocol, AND what I'm doing here has nothing at all to do with that. So what's up with that message?
Secondary question: sometimes I can get to my navigationController via self.navigationController
, and sometimes I can't, and have to go to my app delegate's property to get it like I'm doing here. Any hint about why that is would be very useful.