What is the best (least code, fastest, most reliable) way to compare two NSUUIDs
?
Here is an example:
-(BOOL)isUUID:(NSUUID*)uuid1 equalToUUID:(NSUUID*)uuid2
{
return ... // YES if same or NO if not same
}
From the NSUUID class reference:
Note: The NSUUID class is not toll-free bridged with CoreFoundation’s CFUUIDRef. Use UUID strings to convert between CFUUID and NSUUID, if needed. Two NSUUID objects are not guaranteed to be comparable by pointer value (as CFUUIDRef is); use isEqual: to compare two NSUUID instances.
So just use the following:
-(BOOL)isUUID:(NSUUID*)uuid1 equalToUUID:(NSUUID*)uuid2
{
return [uuid1 isEqual:uuid2];
}