Possible Duplicate:
crashing on ios device while navigation using UIModalTransitionStylePartialCurl in xcode 4
HI I am making an app which is a test, halfway through the middle, i run, and i get a crash in my switching page code, this never happened before, suddenly it happened. weird right? This is my code:
-(IBAction)fail {
Fail *fail = [[Fail alloc]
initWithNibName:@"Fail" bundle:nil];
fail.modalTransitionStyle = UIModalTransitionStylePartialCurl;
[self presentModalViewController:fail animated:YES];
}
Here is my console crash log:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nested modal view controller while curled <QThree: 0x5537190>.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00f025a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x01056313 objc_exception_throw + 44
2 UIKit 0x000d2bac -[UIViewController presentModalViewController:withTransition:] + 741
3 Smart2 0x0000730a -[QThree fail] + 135
4 UIKit 0x0001f4fd -[UIApplication sendAction:to:from:forEvent:] + 119
5 UIKit 0x000af799 -[UIControl sendAction:to:forEvent:] + 67
6 UIKit 0x000b1c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
7 UIKit 0x000b07d8 -[UIControl touchesEnded:withEvent:] + 458
8 UIKit 0x00043ded -[UIWindow _sendTouchesForEvent:] + 567
9 UIKit 0x00024c37 -[UIApplication sendEvent:] + 447
10 UIKit 0x00029f2e _UIApplicationHandleEvent + 7576
11 GraphicsServices 0x0113b992 PurpleEventCallback + 1550
12 CoreFoundation 0x00ee3944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
13 CoreFoundation 0x00e43cf7 __CFRunLoopDoSource1 + 215
14 CoreFoundation 0x00e40f83 __CFRunLoopRun + 979
15 CoreFoundation 0x00e40840 CFRunLoopRunSpecific + 208
16 CoreFoundation 0x00e40761 CFRunLoopRunInMode + 97
17 GraphicsServices 0x0113a1c4 GSEventRunModal + 217
18 GraphicsServices 0x0113a289 GSEventRun + 115
19 UIKit 0x0002dc93 UIApplicationMain + 1160
20 Smart2 0x00003092 main + 83
21 Smart2 0x00002911 start + 53
)
terminate called after throwing an instance of 'NSException'
I have no idea what the problem is, especially why it suddenly rose up in one build, i cant remember which code i added because its actually been a while since i last built. SOO!
You have already presented a view modally with a page curl effect, according to the ‘crash’. Unlike other modal presentations, page curl modal view controllers cannot be stacked. Therefore, this exception is being raised as this is what you are trying to do; present a modal view controller inside another modal view controller with a page curl effect.
To stop this, you are going to have to refactor your app workflow or present the first modal view controller with a different animation.