Why am I getting this warning about my app delegate and CLLocationManageDelegate?

Posted by Dan Ray on Stack Overflow See other posts from Stack Overflow or by Dan Ray
Published on 2010-06-14T14:28:52Z Indexed on 2010/06/14 14:32 UTC
Read the original article Hit count: 262

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk