:(id)送信者を追加した後、このルーチンからクラッシュするので、どのボタンが呼び出されたかを判断できます。プレーンな古いtoggleView3として設定すると、完全に動作します。 detailViewをdocViewに戻すと、クラッシュが発生します。NSInvalidArgumentException
'NSInvalidArgumentException', reason: '*** -[RootViewController toggleView3]: unrecognized selector sent to instance 0x524a00' 2009-04-07 12:29:44.421 eTarot[11405:20b] Stack:
-(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];
}
toggleView3を呼び出すコードを投稿することはできますか? – cobbal