gpt4 book ai didi

iphone - NSInvalidArgumentException 异常

转载 作者:太空狗 更新时间:2023-10-30 03:47:43 26 4
gpt4 key购买 nike

我在添加 :(id)sender 后遇到此例程的崩溃,因此我可以确定调用它的按钮。当设置为普通的旧 toggleView3 时,它可以完美运行。当 detailView 切换回 docView 时发生崩溃。

'NSInvalidArgumentException',原因:'*** -[RootViewController toggleView3]:无法识别的选择器发送到实例 0x524a00'
2009-04-07 12:29:44.421 eTarot[11405:20b] 堆栈:

-(IBAction)toggleView3:(id)sender{


if (detailViewController == nil) {
[self loadDetailViewController];
}

UIView *docView = docViewController.view;
UIView *detailView = detailViewController.view;

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:([docView superview] ? UIViewAnimationTransitionFlipFromRight : UIViewAnimationTransitionFlipFromLeft) forView:self.view cache:YES];

if ([docView superview] != nil) {
[detailViewController viewWillAppear:YES];
[docViewController viewWillDisappear:YES];
[docView removeFromSuperview];

[self.view addSubview:detailView];
[self.view insertSubview:detailNavigationBar aboveSubview:detailView];
[docViewController viewDidDisappear:YES];
[detailViewController viewDidAppear:YES];

} else {
[docViewController viewWillAppear:YES];
[detailViewController viewWillDisappear:YES];
[detailView removeFromSuperview];
[detailNavigationBar removeFromSuperview];
[self.view addSubview:docView];
[detailViewController viewDidDisappear:YES];
[docViewController viewDidAppear:YES];
}
[UIView commitAnimations];
}

最佳答案

您正在发送 View toggleView3 选择器的正确名称为 toggleView3: - 即带有colon和crompt。它们可能看起来与您相似,但它们是与 Objective-C 完全不同的方法。

关于iphone - NSInvalidArgumentException 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/726727/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com