如何获取当前的view controller
2015-02-06
展开全部
//获取view的controller
- (UIViewController *)viewController {
for (UIView* next = [self superview]; next; next = next.superview) {
UIResponder *nextResponder = [next nextResponder];
if ([nextResponder isKindOfClass:[UIViewController class]]) {
return (UIViewController *)nextResponder;
毕搏 }
}
return nil;
}
//点击提交按钮手枯祥
-(void)buttonPress{
败冲
ElectronFrom *electronForm=[[ElectronFrom alloc]init];
[[self viewController].navigationController pushViewController:electronForm animated:YES];
[electronForm release];
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询