A universally unique value that can be used to identify types, interfaces, and other items.
- iOS 6.0+
- macOS 10.8+
- tvOS 9.0+
- watchOS 2.0+
UUIDs (Universally Unique Identifiers), also known as GUIDs (Globally Unique Identifiers) or IIDs (Interface Identifiers), are 128-bit values. UUIDs created by
NSUUID conform to RFC 4122 version 4 and are created with random bytes.
The standard format for UUIDs represented in ASCII is a string punctuated by hyphens, for example
68753A44-4D6F-1226-9C60-0050E4C00067. The hex representation looks, as you might expect, like a list of numerical values preceded by 0x. For example,
0x67. Because a UUID is expressed simply as an array of bytes, there are no endianness considerations for different platforms.
NSUUID class is not toll-free bridged with CoreFoundation’s
CFUUIDRef. Use UUID strings to convert between
NSUUID, if needed. Two
NSUUID objects are not guaranteed to be comparable by pointer value (as
CFUUIDRef is); use
is to compare two