21
右ボタンをUINavigationControllerに追加する方法は?
ナビゲーションコントローラーのトップバーに更新ボタンを追加しようとしていますが、うまくいきません。 これがヘッダーです: @interface PropertyViewController : UINavigationController { } これが私がそれを追加しようとしている方法です: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithTitle:@"Show" style:UIBarButtonItemStylePlain target:self action:@selector(refreshPropertyList:)]; self.navigationItem.rightBarButtonItem = anotherButton; } return self; }