您好,我正在尝试从 subview 返回到主视图,但是当我执行按钮操作时出现此错误
performSelector:withObject:withObject:]: message sent to deallocated instance 0x16dd0700
这是我的代码
UIViewController *subController = [self.storyboard instantiateViewControllerWithIdentifier:@"nextView"];
subController.view.frame = CGRectMake(0, 0, 568, 320);
((thrownAtMeItem*) subController).delegate = self;
[self.view addSubview:subController.view];
在下一个 View 中,我只有一个按钮,在它的操作中,我正在编写 nslog。
最佳答案
只要你需要,就持有对 subController 的强引用。 (只要它的 View 正在显示)
关于ios - 发送到释放实例的消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23493548/