我正在尝试将重新加载按钮添加到导航控制器的顶部栏,但没有成功。
以下是标题:
@interface PropertyViewController : UINavigationController {
}
以下是我尝试添加它的方法:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
UIBarButtonItem *reload = [[UIBarButtonItem alloc] initWithTitle:@"Show" style:UIBarButtonItemStylePlain
target:self action:@selector(reloadPropertyList:)];
self.navigationItem.leftBarButtonItem = reload;
}
return self;
}