【问题标题】:Build error with UILocalNotification with older deployment target in XCode 4使用 XCode 4 中较旧的部署目标使用 UILocalNotification 构建错误
【发布时间】: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


【解决方案1】:

看来问题是因为我将 iOS 部署目标设置为 3.2。我已将其设置为 3.2.1,现在它构建良好。可能是因为 3.2 只是 iPad,但同样的事情发生在应用程序的 iPad 版本上,所以我不确定。 杰森

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-03-30
    • 2021-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-23
    • 2011-03-10
    • 1970-01-01
    相关资源
    最近更新 更多