[AppDelegate window]: unrecognized selector sent to instance 0x283f6c470

做了一个demo新建了一个项目  一直运行报错[AppDelegate window]: unrecognized selector sent to instance 0x283f6c470   并且卡一会儿就崩溃

最后发现xcode创建的时候没有给window属性

在AppDelegate.h添加window属性就可以了   如果还有问题就在AppDelegate.m里面创建一下window对象

#import

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow * window;

@end

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容