Objective-c:iPhone 编程错误(SIGABRT)

发布于 2024-09-07 13:00:34 字数 4771 浏览 4 评论 0原文

这是控制台中显示的错误:

  objc[1589]: Class Account is implemented in both /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/PrivateFrameworks/Message.framework/Message and /Users/hugohnery-garon/Library/Application Support/iPhone Simulator/4.0/Applications/E6874214-2DFA-4446-942D-B8215721A4F9/Drunke!.app/Drunke!. One of the two will be used. Which one is undefined.
    2010-06-29 17:50:50.108 Drunke![1589:207] -[Account initWithCoder:]: unrecognized selector sent to instance 0x7269bb0
    2010-06-29 17:50:50.113 Drunke![1589:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Account initWithCoder:]: unrecognized selector sent to instance 0x7269bb0'
    *** Call stack at first throw:
    (
        0   CoreFoundation                      0x02b3d919 __exceptionPreprocess + 185
        1   libobjc.A.dylib                     0x02c8b5de objc_exception_throw + 47
        2   CoreFoundation                      0x02b3f42b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
        3   CoreFoundation                      0x02aaf116 ___forwarding___ + 966
        4   CoreFoundation                      0x02aaecd2 _CF_forwarding_prep_0 + 50
        5   UIKit                               0x004e3699 -[UIClassSwapper initWithCoder:] + 237
        6   UIKit                               0x005ba77e UINibDecoderDecodeObjectForValue + 2592
        7   UIKit                               0x005ba076 UINibDecoderDecodeObjectForValue + 792
        8   UIKit                               0x005bb42d -[UINibDecoder decodeObjectForKey:] + 398
        9   UIKit                               0x0039a77e -[UIViewController initWithCoder:] + 1039
        10  UIKit                               0x003ab836 -[UITabBarController initWithCoder:] + 58
        11  UIKit                               0x005ba77e UINibDecoderDecodeObjectForValue + 2592
        12  UIKit                               0x005bb42d -[UINibDecoder decodeObjectForKey:] + 398
        13  UIKit                               0x0039a570 -[UIViewController initWithCoder:] + 513
        14  UIKit                               0x004e3699 -[UIClassSwapper initWithCoder:] + 237
        15  UIKit                               0x005ba77e UINibDecoderDecodeObjectForValue + 2592
        16  UIKit                               0x005bb42d -[UINibDecoder decodeObjectForKey:] + 398
        17  UIKit                               0x004e333c -[UIRuntimeConnection initWithCoder:] + 153
        18  UIKit                               0x005ba77e UINibDecoderDecodeObjectForValue + 2592
        19  UIKit                               0x005ba076 UINibDecoderDecodeObjectForValue + 792
        20  UIKit                               0x005bb42d -[UINibDecoder decodeObjectForKey:] + 398
        21  UIKit                               0x004e2634 -[UINib instantiateWithOwner:options:] + 804
        22  UIKit                               0x004e44b5 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
        23  UIKit                               0x002f39bb -[UIApplication _loadMainNibFile] + 172
        24  UIKit                               0x002f490d -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 198
        25  UIKit                               0x002fe452 -[UIApplication handleEvent:withNewEvent:] + 1958
        26  UIKit                               0x002f7074 -[UIApplication sendEvent:] + 71
        27  UIKit                               0x002fbac4 _UIApplicationHandleEvent + 7495
        28  GraphicsServices                    0x03216afa PurpleEventCallback + 1578
        29  CoreFoundation                      0x02b1edc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
        30  CoreFoundation                      0x02a7f737 __CFRunLoopDoSource1 + 215
        31  CoreFoundation                      0x02a7c9c3 __CFRunLoopRun + 979
        32  CoreFoundation                      0x02a7c280 CFRunLoopRunSpecific + 208
        33  CoreFoundation                      0x02a7c1a1 CFRunLoopRunInMode + 97
        34  UIKit                               0x002f4226 -[UIApplication _run] + 625
        35  UIKit                               0x002ffb58 UIApplicationMain + 1160
        36  Drunke!                             0x0000213e main + 84
        37  Drunke!                             0x000020e1 start + 53
        38  ???                                 0x00000001 0x0 + 1
    )
    terminate called after throwing an instance of 'NSException'
    Program received signal:  “SIGABRT”.
    kill
    quit

    The Debugger has exited with status 0.

好的,现在我更改了 MyAccount 的名称,但它没有解决问题。

this is the error show in console :

  objc[1589]: Class Account is implemented in both /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/PrivateFrameworks/Message.framework/Message and /Users/hugohnery-garon/Library/Application Support/iPhone Simulator/4.0/Applications/E6874214-2DFA-4446-942D-B8215721A4F9/Drunke!.app/Drunke!. One of the two will be used. Which one is undefined.
    2010-06-29 17:50:50.108 Drunke![1589:207] -[Account initWithCoder:]: unrecognized selector sent to instance 0x7269bb0
    2010-06-29 17:50:50.113 Drunke![1589:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Account initWithCoder:]: unrecognized selector sent to instance 0x7269bb0'
    *** Call stack at first throw:
    (
        0   CoreFoundation                      0x02b3d919 __exceptionPreprocess + 185
        1   libobjc.A.dylib                     0x02c8b5de objc_exception_throw + 47
        2   CoreFoundation                      0x02b3f42b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
        3   CoreFoundation                      0x02aaf116 ___forwarding___ + 966
        4   CoreFoundation                      0x02aaecd2 _CF_forwarding_prep_0 + 50
        5   UIKit                               0x004e3699 -[UIClassSwapper initWithCoder:] + 237
        6   UIKit                               0x005ba77e UINibDecoderDecodeObjectForValue + 2592
        7   UIKit                               0x005ba076 UINibDecoderDecodeObjectForValue + 792
        8   UIKit                               0x005bb42d -[UINibDecoder decodeObjectForKey:] + 398
        9   UIKit                               0x0039a77e -[UIViewController initWithCoder:] + 1039
        10  UIKit                               0x003ab836 -[UITabBarController initWithCoder:] + 58
        11  UIKit                               0x005ba77e UINibDecoderDecodeObjectForValue + 2592
        12  UIKit                               0x005bb42d -[UINibDecoder decodeObjectForKey:] + 398
        13  UIKit                               0x0039a570 -[UIViewController initWithCoder:] + 513
        14  UIKit                               0x004e3699 -[UIClassSwapper initWithCoder:] + 237
        15  UIKit                               0x005ba77e UINibDecoderDecodeObjectForValue + 2592
        16  UIKit                               0x005bb42d -[UINibDecoder decodeObjectForKey:] + 398
        17  UIKit                               0x004e333c -[UIRuntimeConnection initWithCoder:] + 153
        18  UIKit                               0x005ba77e UINibDecoderDecodeObjectForValue + 2592
        19  UIKit                               0x005ba076 UINibDecoderDecodeObjectForValue + 792
        20  UIKit                               0x005bb42d -[UINibDecoder decodeObjectForKey:] + 398
        21  UIKit                               0x004e2634 -[UINib instantiateWithOwner:options:] + 804
        22  UIKit                               0x004e44b5 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
        23  UIKit                               0x002f39bb -[UIApplication _loadMainNibFile] + 172
        24  UIKit                               0x002f490d -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 198
        25  UIKit                               0x002fe452 -[UIApplication handleEvent:withNewEvent:] + 1958
        26  UIKit                               0x002f7074 -[UIApplication sendEvent:] + 71
        27  UIKit                               0x002fbac4 _UIApplicationHandleEvent + 7495
        28  GraphicsServices                    0x03216afa PurpleEventCallback + 1578
        29  CoreFoundation                      0x02b1edc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
        30  CoreFoundation                      0x02a7f737 __CFRunLoopDoSource1 + 215
        31  CoreFoundation                      0x02a7c9c3 __CFRunLoopRun + 979
        32  CoreFoundation                      0x02a7c280 CFRunLoopRunSpecific + 208
        33  CoreFoundation                      0x02a7c1a1 CFRunLoopRunInMode + 97
        34  UIKit                               0x002f4226 -[UIApplication _run] + 625
        35  UIKit                               0x002ffb58 UIApplicationMain + 1160
        36  Drunke!                             0x0000213e main + 84
        37  Drunke!                             0x000020e1 start + 53
        38  ???                                 0x00000001 0x0 + 1
    )
    terminate called after throwing an instance of 'NSException'
    Program received signal:  “SIGABRT”.
    kill
    quit

    The Debugger has exited with status 0.

Ok now I changed the name for MyAccount, it did not solve the problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

活泼老夫 2024-09-14 13:00:34

您创建了自己的名为 Account 的类,该类与消息框架中名为 Account 的类冲突。尝试将您自己的类重命名为 MyAccount 或您选择的任何名称。

You have created your own class named Account which is conflicting with the class named Account in the Message framework. Try renaming your own class to something like MyAccount or whatever name you choose.

看海 2024-09-14 13:00:34

看起来您已经定义了一个帐户类,该类已在系统框架中定义。在类名前加上一些前缀,这样它们就不会发生冲突。例如我的帐户。

It looks like you have defined a class Account which is already defined in the system frameworks. Prefix your class name with something so they don't clash. eg MYAccount.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文