iphone:在iOS 3.2上从iOS 4.2运行应用程序
我有个问题。我开发了一个应用程序,这个应用程序在iOS 4.2上成功运行。现在我想在iOS 3.2上运行它,但是在加载之前应用程序崩溃了。由于这行代码:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMethod) name:UIApplicationWillEnterForegroundNotification object:nil];
我知道UIApplicationWillEnterForegroundNotification不适用于iOS 3.2。但是当我使用时:
#ifdef __IPHONE_4_0
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDataAfterEnterForeground) name:UIApplicationWillEnterForegroundNotification object:nil];
#endif
应用程序仍在该行代码中运行并再次导致崩溃。我不知道我该怎么办才能让3.2不运行那行代码。
非常感谢你
没有找到相关结果
已邀请:
2 个回复
吠强祷豪硅
烫珊
// #else // #万一