我已下载此源代码here并且其工作正常。
但我需要在SBInstagramCollectionViewController
上添加一个按钮
导航栏,我尝试了下面的代码,但我无法在那里看到那个按钮(看起来有点错误)。
//Add button to NavigationController
UIBarButtonItem *backButton =
[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@“back”, @"")
style:UIBarButtonItemStylePlain
target:self
action:@selector(goBack)];
self.navigationItem.leftBarButtonItem = backButton;
请帮助我....
答案 0 :(得分:0)
尝试在项目中UIBarButtonItem
类的viewDidLoad
方法中添加SBInstagramCollectionViewController.m
的代码
-(void)viewDidLoad {
[super viewDidLoad];
//Other code
//Add button to NavigationController
UIBarButtonItem *backButton =
[[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain
target:self action:@selector(goBack)];
self.navigationItem.leftBarButtonItem = backButton;
}