开发者

Iphone facebook connect example does't call login screen. Why?

开发者 https://www.devze.com 2023-01-31 11:16 出处:网络
i added [se开发者_如何学Clf fbButtonClick:nil]; , but it does\'t call login screen. Why? - (void)viewDidLoad {

i added [se开发者_如何学Clf fbButtonClick:nil]; , but it does't call login screen. Why?

- (void)viewDidLoad {
  _facebook = [[Facebook alloc] initWithAppId:kAppId];
  [self.label setText:@"Please log in"];
  _getUserInfoButton.hidden = YES;
  _getPublicInfoButton.hidden = YES;
  _publishButton.hidden = YES;
  _uploadPhotoButton.hidden = YES;
  _fbButton.isLoggedIn = NO;
  [_fbButton updateImage];

   [self fbButtonClick:nil];
}


You're suppose to call the authorize method on the _facebook object to login. That will call the login screen


i solved this problem with timer

NSTimer *timer = [[NSTimer timerWithTimeInterval:0.001
                                          target:self
                                        selector:@selector(timerFired:)
                                        userInfo:nil
                                         repeats:NO] retain];
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode];

- (void)timerFired:(NSTimer *)timer
{   
  [timer invalidate];
  [timer release];
  timer = nil;

  [self fbButtonClick:nil];
}
0

精彩评论

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

关注公众号