2009-11-18 2 views
0

사용자가 프로그래밍 방식으로 연락처를 편집 할 수있게 해주는 앱을 개발 중입니다. 이iphone에 연락처 정보 수정

내가 ABPersonViewController가 사용되는 것을 발견에 대해

내가 봤. 나는 그것이 그것을 암시하는 방법을 찾을 수 없습니다.

아이폰 OS 용 주소록 프로그래밍 가이드도 나를 위해 작동하지 않습니다.

나에게이 방법을 제안 해 줄 수 있습니까? 마지막에

답변

0

확인을 사전에

Thnx 내가 나 자신에게 솔루션을 여기

찾아야하는 것은 그것을

-(IBAction)showPicker:(id) sender{ 
    ABAddressBookRef addressBook = ABAddressBookCreate(); 
    CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook); 
    ABRecordRef person = CFArrayGetValueAtIndex(allPeople,0); 
    ABPersonViewController *personController = [[ABPersonViewController alloc] init]; 
    personController.displayedPerson = person; 
    personController.addressBook = addressBook; 
    personController.allowsEditing = YES; 
    personController.personViewDelegate = self; 
    UINavigationController *contactNavController = [[UINavigationController alloc] initWithRootViewController:personController]; 
    [personController release]; 
    CFRelease(allPeople); 
    CFRelease(person); 

    [self presentModalViewController:contactNavController animated:YES];  
} 


-(void)personViewControllerDidCancel:(ABPersonViewController *)peoplePicker 
{ 
    [self dismissModalViewControllerAnimated:YES]; 
} 

-(BOOL)personViewController:(ABPersonViewController *)peoplePicker shouldPerformDefaultActionForPerson:(ABRecordRef)person property:(ABPropertyID) property identifier:(ABMultiValueIdentifier) identifier 
{ 
    return YES; 
} 
입니다