【发布时间】:2012-05-01 17:10:28
【问题描述】:
我想知道是否有办法通过代码判断 iPad 是黑色还是白色? 一个简单的谷歌搜索没有发现任何东西。
【问题讨论】:
-
如果你能得到iPad的序列号。
标签: ios ipad cocoa-touch ios5
我想知道是否有办法通过代码判断 iPad 是黑色还是白色? 一个简单的谷歌搜索没有发现任何东西。
【问题讨论】:
标签: ios ipad cocoa-touch ios5
iPhone 上的序列号为您提供了所有这些信息,您只需将颜色代码映射到颜色本身。
iPhone SN 的典型格式如下:AABCCDDDEEF
AA = Factory and Machine ID
B = Year of Manufacturing (9 is 2009/2019, 0 is 2010/2020, 1 is 2011 and so on)
CC = Production Week (01 is week 1 of B, 11 is week 11 of B and so on)
DDD = Unique Identifier
EE = Color (A4=black)
F = size (S=16GB, T=32GB)
http://www.pressbyte.com/640/decode-iphone-hardware-information-serial-number/
此link 可能有助于获取 S/N。
【讨论】:
Apple 设备的颜色可以通过解析其序列号来找到。您可以使用 I/O Kit 获取序列号。请参考:
Differentiate between black and white iPhones?
Using IOKit to return Mac's Serial number returns 4 extra characters
但您需要谨慎,因为 Apple 可能会拒绝您的应用(我还没有尝试在我的应用中使用 libIOKit.a):
If I access the iPhone serial number inside an app, is it allowed in the App Store?
【讨论】: