【发布时间】:2012-06-27 14:07:35
【问题描述】:
我正在尝试像这样推送视图控制器:
SampleViewControllerB *svcb = [self.storyboard instantiateViewControllerWithIdentifier:@"viewB"];
svcb.delegate = self;
[self.navigationController pushViewController:svcb animated:YES];
如果我删除 svcb.delegate = self; 行,它可以正常编译并正常工作。但是,如果我尝试添加它,它将无法编译并给出错误
Property 'delegate' not found on object of type 'SampleViewControllerB *'
有人知道如何解决这个问题吗?提前致谢!
【问题讨论】:
-
SampleViewControlerB是否有属性delegate?我得问问。 -
@Linuxios 我假设 UIViewControllers 默认有一个委托属性。现在改正了,我的错!谢谢!
标签: iphone objective-c ios uiviewcontroller delegates