无法在ipad上显示rightBarButtonItem

时间:2013-01-15 10:23:44

标签: ios5.1

这是我的代码:

UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:vc];
UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithTitle:@"RETURN" style:UIBarButtonItemStylePlain target:self action:@selector(refreshPropertyList:)];
navigationController.navigationItem.rightBarButtonItem = anotherButton;
[anotherButton release];       
[IpadAppDelegate.stackController presentModalViewController:navigationController animated:YES];

enter image description here

1 个答案:

答案 0 :(得分:0)

我找出原因:

需要更改navigationController.navigationItem.rightBarButtonItem = anotherButton;

至:self.navigationItem.rightBarButtonItem = anotherButton;