开发者

Build error with UILocalNotification with older deployment target in XCode 4

I have a project I am trying to build with XCode 4.1 that built fine on 3.2.5. The base sdk is set to 4.3 and the deployment target is set to 3.2. I've reproduced the problem in a simple project with the following code:

    Class notificationClass = NSClassFromString(@"UILocalNotification");

    // Make sure local notifications are supported
    if (notificationClass)
    {
        UILocalNotification *taskNotice = [[notificationClass alloc] init];
        [taskNotice release];
    }

On the UILocalNotification line I get the error: 'UILocalNotification' undeclared (first use in this function)

The relevant settings are: Compiler: LLVM GCC 4.2 (also tried Apple LLVM compiler 2.1) Weak-linked: UIKit, Foundation, CoreGraphics

I've scoured Google and Apple's docs and tried everything I cou开发者_如何学Gold find with no luck. Any help would be greatly appreciated.

Thanks, Jason


Appears that the problem was because I had the iOS Deployment Target set to 3.2. I've set it to 3.2.1 and now it builds fine. May be due to 3.2 being iPad only but the same thing happened on the iPad version of the app so I'm not sure. Jason

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜