Help with a compiler warning: Initialization from distinct Objective-C type when types match
Posted
by Alex Gosselin
on Stack Overflow
See other posts from Stack Overflow
or by Alex Gosselin
Published on 2010-03-09T02:09:06Z
Indexed on
2010/03/09
2:36 UTC
Read the original article
Hit count: 733
Here is the function where I get the compiler warning, I can't seem to figure out what is causing it. Any help is appreciated.
-(void)displaySelector{
//warning on the following line:
InstanceSelectorViewController *controller = [[InstanceSelectorViewController alloc] initWithCreator:self];
[self.navController pushViewController:controller animated:YES];
[controller release];
}
Interface and implementation for the initWithCreator: method
-(InstanceSelectorViewController*)initWithCreator:(InstanceCreator*)creator;
-(InstanceSelectorViewController*)initWithCreator:(InstanceCreator*)crt{
if (self = [self initWithNibName:@"InstanceSelectorViewController" bundle:nil]) {
creator = crt;
}
return self;
}
© Stack Overflow or respective owner