解雇模态视图控制器时出错

时间:2011-06-03 08:06:43

标签: iphone ios4 iphone-sdk-3.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'

以上是崩溃日志。请帮忙。 提前谢谢。

1 个答案:

答案 0 :(得分:0)

从您的日志中,您似乎在window上呼叫NSCFStringNSCFString没有window选择器,如果您尝试这样做,编译器会抱怨,因此很可能是您将该消息发送到解除分配的对象(想象一个新对象已经被分配给以前的另一个人,或者你正在搞乱演员。

如果您怀疑要将消息发送到已解除分配的对象,请启用NSZombies。

如果没有看到代码,就无法进一步帮助您。