开发者

Launch People Picker in viewDidLoad?

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 b开发者_高级运维utton hooked up to instantiate the people picker when it's pressed, and that works fine.

Any suggestions?

Thanks!


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜