【问题标题】:Xcode5 - iOS6 SDK - UDID API ErrorXcode5 - iOS6 SDK - UDID API 错误
【发布时间】:2013-09-21 00:34:48
【问题描述】:

我最近将我的 Xcode 更新为 Xcode5 GM。我注意到这删除了我的 iOS6 SDK,所以我手动将它复制到 Developer/SDKs 中。 Xcode 可以很好地识别这个 SDK。但是,当我尝试使用它编译我的应用程序时,当我尝试检索设备的 UDID 时,它会引发编译器错误。

有人知道为什么会这样吗? UDID API 不应该在 iOS6 SDK 中仍然可用吗?

谢谢,
光辉

【问题讨论】:

  • UDID 已被弃用。从技术上讲,它在 iOS6 中已被弃用,但已被完全删除。我认为出于安全原因已将其删除。
  • 即使对 UDID 的访问权限仍然可用,对它的任何调用都会导致您的应用在提交时被自动拒绝
  • 这是 Apple 的文档developer.apple.com/library/ios/documentation/uikit/reference/…(在 iOS5 而非 6 中已弃用)
  • 是的,我知道它已被弃用。但我预计会出现警告(Xcode 4.6.3 正在这样做)而不是错误。我们使用企业分发来分发,所以 App Store 部分没有问题。
  • 完全删除它的原因是出于安全原因,因此他们在法律上有义务删除它。

标签: ios6 udid xcode5


【解决方案1】:

这似乎在从 App Store 下载的 Xcode 官方版本中运行良好。

【讨论】:

    【解决方案2】:

    UDID 已被弃用。它在 `iOS 5, Official Apple Documentation

    中已被弃用
     uniqueIdentifier
    
     An alphanumeric string unique to each device based on various hardware details. (read-only) 
     (Deprecated in iOS 5.0. Use the identifierForVendor property of this class or the 
     advertisingIdentifier property of the ASIdentifierManager class instead, as appropriate, or use 
     the UUID method of the NSUUID class to create a UUID and write it to the user defaults database.)
    
     @property(nonatomic, readonly, retain) NSString *uniqueIdentifier
    

    (以上摘自 Apple 文档。)

    bengoesboom 指出,即使您的应用程序仍然可用,您的应用程序也会在您提交给 Apple 审核后立即被自动拒绝。这可能是它被完全删除的原因。

    【讨论】:

    • 就像我上面提到的,我们使用企业分发来分发我们的应用程序,所以 App Store 拒绝不是问题.. Xcode 4.6.3 做了正确的事情并发出警告,而 Xcode5 只是抛出错误?
    • 只需使用uniqueIdentifier 而不是developer.apple.com/library/ios/documentation/uikit/reference/… 转换不是一个大问题。
    • 这就是我想要做的事情:以下语句使用 iOS6 SDK 时会抛出错误:udid = [UIDevice currentDevice].uniqueIdentifier;
    • 我不确定,但这可能仍然有效github.com/ylechelle/OpenUDID(但不要强迫我这样做)
    • 抱歉我的意思是identifierForVendor不是uniqueIdentifier
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-06
    • 2014-02-04
    • 1970-01-01
    • 2014-09-03
    相关资源
    最近更新 更多