Question

I want to launch the contacts list people picker as soon as my app has finished loading, but the obvious thing doesn't seem to be working.

- (void)viewDidLoad {
    name.hidden = NO;
    name.text = @"ViewDidLoad";

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

The UILabel named "name" is getting set appropriately, but the people picker doesn't show. I've got a button hooked up to instantiate the people picker when it's pressed, and that works fine.

Any suggestions?

Thanks!

Was it helpful?

Solution

viewDidLoad is not a good place for showing anything since your view is still not ready to be shown. Call it in viewWillAppear.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top