【发布时间】:2011-08-15 18:41:25
【问题描述】:
我有一个项目正在尝试使用 XCode 4.1 构建,该项目在 3.2.5 上构建良好。基础 sdk 设置为 4.3,部署目标设置为 3.2。我用以下代码在一个简单的项目中重现了这个问题:
Class notificationClass = NSClassFromString(@"UILocalNotification");
// Make sure local notifications are supported
if (notificationClass)
{
UILocalNotification *taskNotice = [[notificationClass alloc] init];
[taskNotice release];
}
在 UILocalNotification 行我收到错误:'UILocalNotification' undeclared (first use in this function)
相关设置为: 编译器:LLVM GCC 4.2(也尝试过 Apple LLVM 编译器 2.1) 弱链接:UIKit、Foundation、CoreGraphics
我搜索了 Google 和 Apple 的文档,并尝试了所有我能找到的东西,但都没有成功。任何帮助将不胜感激。
谢谢, 杰森
【问题讨论】:
-
快速说明:将目标设备系列更改为 iPad 可以解决问题。这是一个 iPhone 应用程序,所以这无济于事。
-
看起来问题是由于 iOS 部署目标设置为 3.2。将其设置为 3.2.1 使问题消失。我可以忍受这一点。由于我的声誉太低,我还不能回答这个问题,所以我必须再等 5 个小时。那我来回答吧。
标签: xcode deployment build uilocalnotification