关于iPhone中的地址簿相当有趣的问题

时间:2011-02-17 11:57:38

标签: iphone

我所有人都看到苹果名称的例子为'QUICK CONTACTS',这里有一个错误 人查看控制器。在这里,它始终显示具有两个名称的相同数据

// Fetch the address book 
ABAddressBookRef addressBook = ABAddressBookCreate();
// Search for the person named "Appleseed" in the address book
NSArray *people = (NSArray *)ABAddressBookCopyPeopleWithName(addressBook, CFSTR("Appleseed"));
// Display "Appleseed" information if found in the address book 
if ((people != nil) && [people count])
{
    ABRecordRef person = (ABRecordRef)[*people objectAtIndex:0*];
    ABPersonViewController *picker = [[[ABPersonViewController alloc] init] autorelease];
    picker.personViewDelegate = self;
    picker.displayedPerson = person;
    // Allow users to edit the person’s information
    picker.allowsEditing = YES;
    [self.navigationController pushViewController:picker animated:YES];
}

这里它总是为两个同名的人显示相同的信息,我们怎么能删除这个错误。

1 个答案:

答案 0 :(得分:0)

与你想问的问题相当混淆..如果你得到相同的数据意味着两次相同的数据输入..你在模拟器上工作吗?