IPhone OS4 error when starting on OS3.x

I put together an application with a basic SDK 4.0 for IPhone 4.0, the goal of deployment on iPhone OS 3.0. This app contains a new OS 4.0 feature: local notification.

It works well on iPod 2G with OS 4.0; however, it crashes every time the application launches on the iPhone 1G with OS 3.0. It looks like this error in the checklist:

"dyld: Symbol not found: _OBJC_CLASS _ $ _ UILocalNotification Link from: / var / mobile / Applications / 73A3FAB1-63AE-4A71-8C6B-932142A728FE / Tapatalk X.app/Tapatalk X Expected in: / System / Library / Frameworks / UIKit .framework / UIKit "

If the UIKit structure is different between SDK3.0 and SDK4.0, why doesn't it tell you when compiling? How can I apply the local notification function in this application, and the application can still work on devices with OS3.0? Thank you

+3
source share
3 answers

This answer solved the problem for me:

This error is triggered because you are not a weak-link UIKit framework. The UIKit framework in iPhone OS 3.2 added a UISplitViewController, and if you link this normally, your application will assume that these characters exist on 3.0, where they do not.

, Xcode, "". , . UIKit . .

, , UIKit , .

+8

SDK 4.0 3.0 , , .

( ), :

Class localNotificationC = NSClassFromString(@"UILocalNotification");
if (localNotificationC) {
    UILocalNotification* localNotification = [[localNotificationC alloc] init];

    // do stuff

    [localNotification release];
}
else {
    // what to do with the 3.0 SDK
}

, , , , 4.0 SDK, / 4.0.

+1

. , , .

iPad-. BaseSDK 4.3, - 3.2. iPad 3.2, Apple. , , iPad 3.2, , .

[UILocalNotifition alloc] , , , : : EXC_BREAKPOINT (SIGTRAP) : 0x00000001, 0xe7ffdefe

, , . , . 3.2, .

, . - , ? , , .

0
source

Source: https://habr.com/ru/post/1753134/


All Articles