0
我在配件模擬器上啓用了兩個lighbulb型配件。當我嘗試讀取HMService的的serviceType,它返回類似:HomeKit HMService服務類型問題
0000003E-0000-1000-8000-0026BB765291代替HMServiceTypeLightbulb
for (int i = 0; i < [homeKitController.accessories count]; i++) {
HMAccessory *accessory = [homeKitController.accessories objectAtIndex:i];
NSArray *services = accessory.services;
for (int i = 0; i < [services count]; i++) {
HMService *service = [services objectAtIndex:i];
NSLog(@"%@", service.serviceType);// <-returns 0000003E-0000-1000-8000-0026BB765291
}
}
確切的代碼上面的Xcode測試版1在工作(前Xcode 6 GM出來了)。它用於將服務的類型打印爲NSString。現在它打印這個奇數值。任何想法或想法都表示讚賞。