How to create a GUID/UUID using iOS
问题 I want to be able to create a GUID/UUID on the iPhone and iPad. The intention is to be able to create keys for distributed data that are all unique. Is there a way to do this with the iOS SDK? 回答1: [[UIDevice currentDevice] uniqueIdentifier] Returns the Unique ID of your iPhone. EDIT: -[UIDevice uniqueIdentifier] is now deprecated and apps are being rejected from the App Store for using it. The method below is now the preferred approach. If you need to create several UUID, just use this