If you are targeting iOS 7.1 (or later) then you can compare the System.String
Uuid
property of CFUUID
. That's the easiest way. E.g.
if (cbuuid1.Uuid == cbuuid2.Uuid)
Console.WriteLine ("Equal");
else
Console.WriteLine ("Different");
Otherwise (iOS 7.0 and earlier) you'll need to compare the NSData
Data
properties of CFUUID
. First compare their length and, if equal, compare each byte inside them. E.g.
bool equal = false;
using (var d1 = cbuuid1.Data)
using (var d2 = cbuuid2.Data) {
if (d1.Lenght == d2.Length) {
for (int i=0; i < d1.Lenght; i++) {
if (d1 [i] != d2 [i]) {
equal = false;
break;
}
}
}
}
Console.WriteLine (equal ? "Equal" : "Different");