iphone中的UIButton操作异常

iphone中的UIButton操作异常,iphone,objective-c,Iphone,Objective C,我正在使用此代码移回tableview,但它给出了错误 但是当我使用 [self.navigationController pushViewControllerAnimated:YES]; 它可以工作,但不能与popViewController一起工作 CategoriesList*targetController=[[CategoriesList alloc]init]; [self.navigationController popViewControllerAnimated:YES];

我正在使用此代码移回tableview,但它给出了错误

但是当我使用

[self.navigationController pushViewControllerAnimated:YES];
它可以工作,但不能与popViewController一起工作

CategoriesList*targetController=[[CategoriesList alloc]init];
[self.navigationController popViewControllerAnimated:YES];

如果您只想在堆栈顶部弹出视图控制器,那么就得到了正确的方法签名。错误是什么?那么试试这个:

 [self.navigationController popToViewController:targetController animated:YES];
从文档:

- (UIViewController *)popViewControllerAnimated:(BOOL)animated

@Jolly good几乎是正确的

更改:

[self.navigationController popViewControllerAnimated:YES];

[self.navigationController popToViewController:targetController animated:YES];