我正在检索phoneNumbers
,我得到一个断点。我花了过去几个小时试图修复它,但仍然没有运气。
-(void)textMessage{
ABAddressBookRef addressBook = ABAddressBookCreate();
NSMutableArray *array =[[NSMutableArray alloc]init];
NSMutableArray *temp;
NSMutableArray *temp2 = [[NSMutableArray alloc]init];
for(int i =0;i<[savedPeople count];i++){
NSString *temp = (NSString*) ABAddressBookCopyPeopleWithName(addressBook, (CFStringRef)[savedPeople objectAtIndex:i]);
NSLog(@"%@",temp);
[temp2 addObject:temp];
ABRecordRef thisPerson = (ABRecordRef)[temp2 objectAtIndex:i];
ABMultiValueRef phoneProperty = ABRecordCopyValue(thisPerson, kABPersonPhoneProperty);
NSLog(@"%@",phoneProperty);
}
array = temp2;
NSLog(@"%@",array);
CFRelease(addressBook);
}
有人知道它有什么问题吗?