2011-07-29 59 views

回答

0
+0

是的,這是可能的,但情況是,當APP用戶陶斯接觸,他會問他你是否屬於英國或者不屬於他。他選擇是的,我們應該在現有聯繫人前加49,但不應該干擾b本地聯繫人。聯繫人列表必須相同。但在APP中,只有我們必須將...添加+49 ... – user857280

+0

如果您徹底研究鏈接,則會找到訪問聯繫人並將號碼添加到它只在您的應用程序內向用戶顯示。但是,您需要自己的觀點才能顯示聯繫人。你將無法使用人員選擇器。或者你可以複製你的應用程序的地址簿,並添加你想要的前綴。 –

+0

我沒有在應用程序中保留任何聯繫人。我正在訪問本地聯繫人。我想在APP中打電話時加上+49。結束通話後,該號碼不應該改變... – user857280

1
-(void)showPersonViewController:(NSString *)nameInContact 
{ 
    // Fetch the address book 
    ABAddressBookRef addressBook = ABAddressBookCreate(); 
    // Search for the person in the address book 
    NSArray *people = (NSArray *)ABAddressBookCopyPeopleWithName(addressBook, CFSTR(nameInContact)); 
    // Display the 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]; 
    } 
    else 
    { 
     // Show an alert if the person is not in Contacts 
     UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" 
                 message:[NSString stringWithFormat:@"Could not find %@ in the Contacts application", nameInContact] 
                 delegate:nil 
               cancelButtonTitle:@"Cancel" 
               otherButtonTitles:nil]; 
     [alert show]; 
     [alert release]; 
    } 

    [people release]; 
    CFRelease(addressBook); 
} 
相關問題