开发者

UInavigationbar with back button

i have uiviewcontroller with navigation bar and a back button on him,and i try to set a method for this bac开发者_运维知识库k button with this :

UIBarButtonItem *rButton = [self.navigationItem leftBarButtonItem];
[rButton setAction:@selector(cancelCheck)];

and when I press the back button this method won't call


    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:self action:@selector(cancelCheck)];


Try setting the target to self (or whatever object that has the cancelCheck selector)

[rButton setTarget:self];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜