1

I am stuck with the strange problem of MGTwitterEngine for iPad because when I use it for iPhone it works perfectly but when I use it for iPad then in method below(delegate method) I am getting username as null but in iPhone it was giving correct(eg.soha00)

Code for calling MGTwitterEngine:-

-(IBAction)loginWithTwitterButtonClicked:(UIButton *)sender
  {
      _engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self];
      _engine.consumerKey = @"PzkZj9g57ah2bcB58mD4Q";
      _engine.consumerSecret = @"OvogWpara8xybjMUDGcLklOeZSF12xnYHLE37rel2g";

      UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine: _engine delegate: self];

      if (controller) 
      {
          [self presentModalViewController: controller animated: YES];
      }

  }

The below method is the delegate method that gets called when authorize button is clicked.

- (void) OAuthTwitterController: (SA_OAuthTwitterController *) controller authenticatedWithUsername: (NSString *) username {

    NSLog(@"Authenticated with user %@", username);
}

In iPhone it is showing username properly but on iPad it is returning nil.

Please suggest me what might be the problem or how could I sort this issue. Please help me. Thanks in advance!

Gypsa
  • 11,230
  • 6
  • 44
  • 82
  • 1
    I see the source code of these classes is available on the Internet. Have you thought about running the code in the debugger to see where the username actually comes from? – JeremyP Sep 27 '11 at 08:39
  • no I dont know about that.I will see it. – Gypsa Sep 27 '11 at 09:31
  • @JeremyP please help me if you know something on from where did username comes from. – Gypsa Sep 29 '11 at 11:36
  • Sorry, I was only suggesting to do what I would do as a first step. I'd debug the application to understand where the user name comes from. – JeremyP Sep 30 '11 at 11:13

0 Answers0