这里是我得到编译器警告的函数,我似乎无法弄清楚是什么导致它。任何帮助表示赞赏。帮助编译器警告:当类型匹配时从不同的Objective-C类型初始化
-(void)displaySelector{
//warning on the following line:
InstanceSelectorViewController *controller = [[InstanceSelectorViewController alloc] initWithCreator:self];
[self.navController pushViewController:controller animated:YES];
[controller release];
}
接口和实现的initWithCreator:方法
-(InstanceSelectorViewController*)initWithCreator:(InstanceCreator*)creator;
-(InstanceSelectorViewController*)initWithCreator:(InstanceCreator*)crt{
if (self = [self initWithNibName:@"InstanceSelectorViewController" bundle:nil]) {
creator = crt;
}
return self;
}
我记得得到这个错误,问题是我没有导入我需要的头文件。 – 2010-03-09 02:15:38