【问题标题】:Why is NSCalendarDate in the Simulator SDK but not in the iPhone SDK?为什么模拟器 SDK 中有 NSCalendarDate 而 iPhone SDK 中没有?
【发布时间】:2009-06-26 20:35:11
【问题描述】:

我想使用NSCalendarDate,它存在于

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/ System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSCalendarDate.h

但在

下的任何地方都不存在

/Developer/Platforms/iPhoneOS.platform

什么给了?

【问题讨论】:

    标签: iphone calendar date


    【解决方案1】:

    在 10.5 之后,NSCalendarDate 将被弃用。因此它可能只是不存在于 iPhone SDK 中:

    重要提示:NSCalendarDate 的使用 强烈劝阻。它不是 已弃用,但它可能在 Mac OS 之后的下一个主要操作系统版本 X v10.5。对于历法计算, 你应该使用合适的组合 NSCalendar、NSDate 和 NSDateComponents,如中所述 CalendarsDate and Time Programming Guide for Cocoa.

    寻找NSCalendarNSDateNSDateComponents的iPhone版本

    【讨论】:

      【解决方案2】:

      我只看到 API 文档中引用的 NSCalendar。我敢打赌,这要么未发布(因此不受支持),要么已弃用。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-02-04
        • 2012-03-25
        • 2011-03-04
        • 2023-03-10
        • 1970-01-01
        • 2021-08-15
        • 2011-01-02
        • 1970-01-01
        相关资源
        最近更新 更多