我有一个模态视图控制器,它根据 if 条件在 viewDidLoad 中调用另一个模态视图控制器。
我面临的奇怪问题是,我第一次编译应用程序并打开第一个模态视图控制器时,它工作正常,并继续显示第二个视图控制器。现在,如果我停止应用程序执行并重建并运行应用程序,当我打开第一个模态视图时,应用程序会崩溃(只有主页按钮工作时冻结)。
这是我得到的错误:
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
_Unwind_Resume called from function -[NSArray makeObjectsPerformSelector:] in image CoreFoundation.
2010-09-23 20:19:56.526 MySuperDuperApp[6117:207] CoreAnimation: ignoring exception: [<TwitterLogin 0x7484dc0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key actionButton.
TwitterLogin 是第二个无法显示的模态视图控制器的名称。
我尝试放置 NSLogs 来检查它到底在哪里崩溃。
//... part of the method which is called in
// viewDidAppear of first modal view controller.
- (void)login {
NSLog(@"Begin TwitterBasicVC login");
loginPopup = [[TwitterLogin alloc] init];
loginPopup.oAuth = oAuth;
loginPopup.viewDelegate = self;
loginPopup.interfaceDelegate = self;
// Show Login screen.
loginPopup.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
NSLog(@"presenting loginPopup modalView");
[self presentModalViewController:loginPopup animated:YES];
[loginPopup release];
NSLog(@"End TwitterBasicVC login");
//... viewDidLoad of second modal view controller.
- (void)viewDidLoad {
NSLog(@"Begin TwitterLogin viewDidLoad");
[super viewDidLoad];
queue = [[NSOperationQueue alloc] init];
...
'presenting loginPopup modalView' 消息被打印,但是'Begin TwitterLogin viewDidLoad' 消息没有被打印。我不知道为什么它在模态视图演示和 viewDidLoad 之间崩溃。
更奇怪的是,每次我构建/运行应用程序时都会发生这种情况。(我已经尝试删除应用程序并构建它,但它仍然会发生)
编辑:我添加了登录方法的前几行,其中 twitterLogin 是分配初始化的。我也尝试使用 performSelector:withObject:afterDelay 调用该方法,值为 0.0 和 1.0,但问题仍然存在。
编辑 2:每次我尝试在 iPhone/模拟器上安装应用程序时(在从设备/模拟器中删除应用程序之后),我都做了一个干净的构建。该应用程序似乎使用这种方法运行良好。我可以假设在应用商店上传应用是安全的吗?
关于我应该如何进行调试的任何建议都会对我有很大帮助:)
谢谢