문제가 있습니다. 나는이 응용 프로그램을 iOS 4.2에서 성공적으로 실행하는 응용 프로그램을 개발합니다. 이제 iOS 3.2에서 실행하고 싶지만로드되기 전에 애플리케이션이 중단됩니다. 때문에이 코드 줄의 :iphone : iOS 3.2의 iOS 4.2에서 애플리케이션 실행
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMethod) name:UIApplicationWillEnterForegroundNotification object:nil];
나는 UIApplicationWillEnterForegroundNotification는 아이폰 OS 3.2을 사용할 수없는 것으로 알고 있습니다. 그러나 내가 사용할 때 :
#ifdef __IPHONE_4_0
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadDataAfterEnterForeground) name:UIApplicationWillEnterForegroundNotification object:nil];
#endif
응용 프로그램이 여전히 해당 코드 줄에서 실행되어 다시 충돌이 발생합니다. 나는 3.2가 그 코드를 실행하지 못하게하기 위해 무엇을해야하는지 모른다.
고맙습니다.
당신의 #ifdef와 평가한다 컴파일 타임에는 런타임이 아닙니다. 앱을 ios 4.2 SDK와 연결하면 조건이 충족됩니다. – Kai