Objective c 从情节提要加载的UIViewController内存异常
点击一个按钮,我将使用以下代码从我的故事板加载到Objective c 从情节提要加载的UIViewController内存异常,objective-c,uiviewcontroller,Objective C,Uiviewcontroller,点击一个按钮,我将使用以下代码从我的故事板加载到UIViewController InfoViewController *dst = [self.storyboard instantiateViewControllerWithIdentifier:@"InfoViewIdentifier"]; [self.view insertSubview:dst.view atIndex:0]; dst.view.frame = CGRectMake(0, 480, 320, 480); [UIView
UIViewController
InfoViewController *dst = [self.storyboard instantiateViewControllerWithIdentifier:@"InfoViewIdentifier"];
[self.view insertSubview:dst.view atIndex:0];
dst.view.frame = CGRectMake(0, 480, 320, 480);
[UIView beginAnimations: @"infoAnimation" context: nil];
[UIView animateWithDuration: 1.0f animations: ^{dst.view.frame = CGRectMake(0, 0, 320, 480);}];
[UIView commitAnimations];
一切都很好。生成的视图上有几个按钮,可以执行简单的操作(关闭视图、在safari中打开URL等),只要我点击其中任何一个按钮,就会收到一个异常。奇怪的是,它可能抛出两个异常中的一个
- 线程1:EXC_BAD_ACCESS(代码=1,地址=…)-显示应用程序仍在异常断点中运行
- 缺少标识符UpstreamPlaceholder-2的代理-显示在日志中
如果有任何帮助,我们将不胜感激。好的,这里是noob的全部问题。该问题与在方法中使用局部变量有关。ARC大部分时间都在扼杀内存中的视图(我的80%引用)。我将
dst
变量移到了头文件中,一切都正常工作。要添加到前面的答案中:
缺少标识符UpstreamPlaceholder xx的代理也可能在情节提要错误配置中抛出。
就像重复的细胞标识符