0
此應用程序已崩潰,因爲它嘗試訪問隱私敏感的數據而沒有使用說明。該應用程序的Info.plist必須包含一個帶有字符串值的NSContactsUsageDescription項,向用戶解釋應用程序如何使用此數據。如何授權訪問ios 10.0中的手機地址簿?
我加入的.plist NSContactsUsageDescription
不工作 - 設備版本:10.0
KTSContactsManager *addressBookManager = [KTSContactsManager sharedManager];
addressBookManager.delegate = self;
addressBookManager.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"firstName" ascending:YES]];
if ([isAddressBookTaken isEqualToString:@"false"]) {
[addressBookManager importContacts:^(NSArray *contacts) {
[EBLogger logWithTag:@"TBLContactManager" withBody:@"importContacts"];
DLPhoneBook *phoneBook = [DLPhoneBook new];
NSMutableArray *mutableArray = [NSMutableArray new];
for (int i = 0; i < contacts.count; ++i) {
NSDictionary *record = [contacts objectAtIndex:i];
NSError *err = nil;
DLContactRecord *contactRecord = [[DLContactRecord alloc] initWithDictionary:record error:&err];
NSLog(@" %@ %@ %@ '",contactRecord.firstName, contactRecord.lastName, contactRecord.id);
}
}
嗨@KAR感謝您的回答,我做了你已經解釋過的事情,但我一直得到同樣的錯誤。我也刪除應用程序和drived數據文件。 – user3172307
檢查此鏈接是否對您有用,https://forums.developer.apple.com/thread/62229 – KAR
+設置> MyApp>「聯繫人」不會出現! – user3172307