I have A -> B - >C controllers, linked with the next delegate:
@protocol ViewControllerDelegate <NSObject>
- (void)onResult:(ControllerDelegateObject *)delegateObject;
@end
and in CI call:
- (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:
-(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?
If you want to go to 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.
- popToViewController:animated:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.