views:

40

answers:

1

How can I wait for the contact to be chosen in my address book, before going on?

Hereunder the code I use

BPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
[self presentModalViewController:picker animated:YES];

//following code

Right now it just proceeds with executing the code...

Thanks

+1  A: 

Are you implementing the delegate methods?

- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person

If you are, move the "following code" into the delegate method, so after the user picks a person you can move on.

Pyro2927
Worked great, thanks