Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 swift 2 中有以下代码
let deviceid = UIDevice.currentDevice().identifierForVendor!.UUIDString
这无法编译。我尝试遵循 xCode 中自动修复的建议,我想出了这个。
let deviceid = UIDevice.currentDevice.identifierForVendor!.UUIDString
但是它仍然无法编译。它说'UUID'类型的值没有成员UUIDString'
我的建议 - 对于这类问题 - 直接进入操场
let deviceid = UIDevice.current.identifierForVendor?.uuidString