开发者

Launch People Picker in viewDidLoad?

开发者 https://www.devze.com 2023-02-19 19:19 出处:网络
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.

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

精彩评论

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

关注公众号