After installing Xcode 5, getting error on launch [closed]

孤街浪徒 提交于 2019-12-20 05:23:18

问题


I lately have been using the Xcode 5 preview to develop for ios 7. Since I have in stalled the final version, my app hasn't been running. When the app begins to load, I get this...

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

This is my error message-

2013-09-21 16:30:33.117 App Name[6039:60b] -[AppDelegate window]: unrecognized selector sent to instance 0x15e70080 2013-09-21 16:30:33.128 App Name[6039:60b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AppDelegate window]: unrecognized selector sent to instance 0x15e70080' * First throw call stack: (0x2d488e8b 0x377826c7 0x2d48c7b7 0x2d48af55 0x2d3d9e98 0x60c1d 0x2fc7f425 0x2fc7ee6b 0x2fc794b9 0x2fc13be7 0x2fc12edd 0x2fc78ca1 0x320f476d 0x320f4357 0x2d45377f 0x2d45371b 0x2d451ee7 0x2d3bc541 0x2d3bc323 0x2fc77f43 0x2fc731e5 0x74cd5 0x37c7bab7) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)


回答1:


The error message -[AppDelegate window]: unrecognized selector sent to instance indicates that your appDelegate class is missing the required UIWindow *window property. Your appDelegate header file should look like this at a minimum:

 @interface AnyNameAppDelegate : UIResponder <UIApplicationDelegate>
 @property (strong, nonatomic) UIWindow *window;
 @end


来源:https://stackoverflow.com/questions/18927442/after-installing-xcode-5-getting-error-on-launch

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!