这意味着您在同一范围内有一个实例变量,其名称为homeViewController
.
因此,您希望通过重命名临时文件来避免歧义:
MySpyHomeViewController * homeView = [[MySpyHomeViewController alloc]
^^^^^^^^ initWithNibName:nil bundle:nil];
self.navController =
[[UINavigationController alloc] initWithRootViewController:homeView];
^^^^^^^^
更详细地说,您的示例出现在一个实例方法中,并且实现该方法的类有一个名为的实例变量homeViewController
——一个实例变量可以在 objc 的许多地方声明,例如:
@interface MONClass : NSObject
{
@private
HomeViewController * homeViewController;
}
@interface MONClass ()
{
HomeViewController * homeViewController;
}
@implementation MONClass
{
HomeViewController * homeViewController;
}
@interface MONClass : NSObject
@property (nonatomic, retain, readwrite) HomeViewController * homeViewController;
@end
@implementation MONClass
@synthesize homeViewController = homeViewController;
@end