//在viewDidLoad中加入這兩行,override返回鍵的方法
self.navigationItem.backBarButtonItem.target = self;
self.navigationItem.backBarButtonItem.action = @selector(backButtonDidPressed:);
//宣告這個方法來執行你要在back前做的事
- (void)backButtonDidPressed:(id)aResponder {
//do your stuff
//but don't forget to dismiss the viewcontroller
[self.navigationController popViewControllerAnimated:YES];
}
沒有留言:
張貼留言