- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
[UIDevice currentDevice]
可以带什么,比如uniqueIdentifier?谢谢!
最佳答案
因为这有点过时了,所以我只是给出一个最新的答案。
因为 Apple
认为从 iOS 6
开始,停止开发人员使用 [[UIDevice currentDevice] uniqueIdentifier];
是合适的, Suhail Patels
回答使用建议。他们现在已经开始告诉开发人员使用 [[UIDevice currentDevice] identifierForVendor];
,但是一些开发人员对是否仍然允许他们使用 uniqueIdentifier
感到困惑,即使他们仍然是否为 iOS 5
及以下版本开发。 Apple
对这句话有点挑剔:
"Apps that use the `UDID` will be rejected in the App Store review process.."
来吧 Apple
给我们更多的细节。
无论如何,由于这背后的困惑,一些开发人员已经开始使用 OpenUDID获得唯一标识符。以下是有关如何使用它的一些代码:
if ([[UIDevice currentDevice] respondsToSelector:@selector(identifierForVendor)]) {
// Use: [[[UIDevice currentDevice] identifierForVendor] UUIDString];
} else {
// Use: [OpenUDID value];
}
编辑
由于 UDID
已被弃用,一些开发人员现在也认为开始使用 MAC 地址是合适的。这是因为 MAC 地址是基于硬件的,因此无法更改。对于那些想要使用 MAC 地址方式的人,苹果在 Getting MAC Address 上提供了一些示例代码。 .
关于ios - [UIDevice currentDevice] 可以使用什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7128828/
我正在为 IOS 制作一个视频播放器,想要检查设备何时旋转,当我的代码将使视频播放器全屏显示时,但我收到以下错误 - 'Instance member 'currentDevice'不能在“viewC
[UIDevice currentDevice]可以带什么,比如uniqueIdentifier?谢谢! 最佳答案 因为这有点过时了,所以我只是给出一个最新的答案。 因为 Apple 认为从 iOS
[[UIDevice currentDevice] model]; 返回的所有可能值是什么?它不是 documented . 最佳答案 可能的值是iPod touch、iPhone、iPhone Si
我的应用程序使用UIDevice currentDevice identifierForVendor来帮助我识别设备。最近,我遇到了一种我无法理解的情况。我的一位客户的iPad的UIDevice cu
我正在尝试使用属性 UIDevice.currentDevice().orientation,所以我有如下内容 UIDevice.currentDevice().beginGeneratingDevi
我试图让我的应用程序(围绕 OpenFrameworks 构建)中的相机自动对焦。看完this SO post我通读了 AV Foundation Programming Guide关于如何设置对焦模
当我为设备方向更改添加通知时,如下所示: NSNotificationCenter.defaultCenter().addObserver(self, selector: Select
我有一个 swift 项目,我想在其中检索设备的名称并显示在 UITableViewCell 中。 但是当我想调用 UIDevice.currentDevice() 时 override func t
[[UIDevice currentDevice] systemName]; 的可能值是什么?在docs来自 Apple,它没有给出任何可能产生的结果的例子,但我能从中得到的只是 iPhone OS,
我有一种产品有两种不同的应用。并且这两个应用程序都为同一设备提供了不同的标识符(您会假设苹果会将其关联到您的开发者帐户,以便您可以在您的应用程序中重复使用这些信息),但我想知道他们能给我什么两个应用程
所以,since Apple is now rejecting apps that access UDID , 在我们公司当前的项目中,我们需要消除所有调用此属性的 API: [[UIDevice c
我们注意到,在 MonoTouch 中使用 UIDevice.CurrentDevice.Name 时,UTF8 字符无法正确显示。 如果您使用某些特殊字符(例如按住 iPad 键盘上的撇号键),它会
我正在使用 x-code 6.3 工具来分析我的应用程序,但我不明白为什么这一行会导致内存泄漏: + (NSString*)IDFV { NSUUID* device_id = [[UIDev
这个问题在这里已经有了答案: The advertisingIdentifier and identifierForVendor return "00000000-0000-0000-0000-00
在我看来这在 iOS9 中不再有效。这是根据我的 SO 研究强制改变方向的实际方法。它现在卡住了我的 SpriteKit 游戏。 只有我一个人吗?如果不是,有人知道替代方案吗? 编辑:Portrait
我正在学习在单元测试中使用 OCMocks,并且我了解基础知识。但是,我不确定如何模拟对类方法的调用。 我想要: [[UIDevice currentDevice] userInterfaceIdio
如题。调用 [[UIDevice currentDevice] BeginGeneratingDeviceOrientationNotifications] 无效。 DidRotateToInterf
这是一个最重要的观察,因为我似乎找到了解决方法...... 当下面的代码位于已推送到 UINavigationController 堆栈的 Controller 中时,它无法工作。在这种情况下,[UI
我在调用 MonoTouch.UIKit.UIDevice.CurrentDevice.SystemVersion 时发生崩溃。它发生在模拟器上。我无法轻松重现它...我已将调试器跟踪放在下面。 使用
我在我的所有应用程序中都使用了[[UIDevice currentDevice] uniqueIdentifier],Apple 不再允许使用uniqueIdentifier。我需要一些东西来替换 u
我是一名优秀的程序员,十分优秀!