2011-06-03 90 views
0

解除模態視圖控制器時遇到應用程序終止。解除模態視圖控制器的錯誤

-[NSCFString window]: unrecognized selector sent to instance 0x6337dc0 
2011-06-03 13:26:37.980 Tuscany[19657:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString window]: unrecognized selector sent to instance 0x6337dc0' 
*** Call stack at first throw: 
(
    0 CoreFoundation      0x016ffbe9 __exceptionPreprocess + 185 
    1 libobjc.A.dylib      0x018545c2 objc_exception_throw + 47 
    2 CoreFoundation      0x017016fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 
    3 CoreFoundation      0x01671366 ___forwarding___ + 966 
    4 CoreFoundation      0x01670f22 _CF_forwarding_prep_0 + 50 
    5 UIKit        0x003f4024 -[UIViewController viewControllerForRotation] + 81 
    6 UIKit        0x003ee8ab -[UIViewController shouldWindowUseOnePartInterfaceRotationAnimation:] + 34 
    7 UIKit        0x00368dd5 -[UIWindow _clientsForRotation] + 350 
    8 UIKit        0x0036b87b -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 141 
    9 UIKit        0x005eb948 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 1053 
    10 UIKit        0x003f7682 -[UIViewController _dismissModalViewControllerWithTransition:from:] + 2075 
    11 UIKit        0x003f4324 -[UIViewController dismissModalViewControllerWithTransition:] + 579 
    12 Foundation       0x000c37f6 __NSFireDelayedPerform + 441 
    13 CoreFoundation      0x016e0fe3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19 
    14 CoreFoundation      0x016e2594 __CFRunLoopDoTimer + 1220 
    15 CoreFoundation      0x0163ecc9 __CFRunLoopRun + 1817 
    16 CoreFoundation      0x0163e240 CFRunLoopRunSpecific + 208 
    17 CoreFoundation      0x0163e161 CFRunLoopRunInMode + 97 
    18 GraphicsServices     0x01d88268 GSEventRunModal + 217 
    19 GraphicsServices     0x01d8832d GSEventRun + 115 
    20 UIKit        0x0035342e UIApplicationMain + 1160 
    21 Tuscany        0x00002878 main + 102 
    22 Tuscany        0x00002809 start + 53 
) 
terminate called after throwing an instance of 'NSException' 

上面是崩潰日誌。請幫忙。 在此先感謝。

+0

你可以將你的代碼粘貼到你提交控制器的地方並解僱它嗎? – KishoreK 2011-06-03 08:13:30

回答

0

從你的日誌看來,你似乎撥打NSCFStringwindowNSCFString沒有window選擇器,如果您嘗試這樣做,編譯器會發出抱怨,因此很可能您將該消息發送給釋放對象(想象一個新對象已被分配到另一個之前的位置),或者你在與演員混戰。

如果您懷疑您要將消息發送到解除分配的對象,請啓用NSZombies。

雖然沒有看到代碼,但它不可能幫助你進一步。