【发布时间】:2011-11-23 10:14:30
【问题描述】:
我的项目使用 ARC,所以我不能使用保留或释放,在 ViewController A 中,我初始化 ViewController B 并将其视图添加为子视图:
ViewControllerB *viewB = [[ViewControllerB alloc] init];
[self.view addSubview:viewB.view];
在 ViewControllerB 中,我创建了一个按钮,当用户单击它时,视图将从 superview 中删除:
[self.view removeFromSuperview];
结果是 EXC_BAD_ACCESS。 请帮助我,对我的英语感到抱歉。
【问题讨论】:
标签: uiviewcontroller exc-bad-access addsubview superview