[英][ self.navigationController popViewControllerAnimated:YES ]; doesn't work in delegate callback
I have A -> B - >C controllers, linked with the next delegate: 我有A-> B-> C控制器,与下一个委托链接:
@protocol ViewControllerDelegate <NSObject>
- (void)onResult:(ControllerDelegateObject *)delegateObject;
@end
and in CI call: 并在CI中致电:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
ControllerDelegateObject *object = [[ControllerDelegateObject alloc]init];
object.model = indexPath.row;
[delegate onResult:object];
[ self.navigationController popViewControllerAnimated:YES ];
}
than I get in B: 比我进去的B:
-(void)onResult:(ControllerDelegateObject *)delegateObject{
delegateObject.brand = self.chosenBrand;
[delegate onResult:delegateObject];
[ self.navigationController popViewControllerAnimated:YES ]; **//doesn't work**
NSLog(@"TEST2");
}
why [ self.navigationController popViewControllerAnimated:YES ] is not called second time in the delegate callback? 为什么[self.navigationController popViewControllerAnimated:YES]在委托回调中没有第二次被调用?
If you want to go to A: 如果要转到A:
popToRootViewControllerAnimated:
Or another choice if you have more than 3 view controller A->B->C->D and you want to go from D to B. 如果您有3个以上的视图控制器A-> B-> C-> D,并且想要从D转到B,则可以选择另一种选择。
- popToViewController:animated:
Refer to UINavigationController Class Reference 请参阅UINavigationController类参考
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.