Search code examples
iphoneiosdelegatestwittermgtwitterengine

crash with OAuthTwitterController delegate


I get a EXC_BAD_ACCESS when this delegate function is called :

 OAuthTwitterController: (SA_OAuthTwitterController *) controller authenticatedWithUsername

any ideas ?

my class looks like this :

@interface QuizzResultController: UIViewController <NSXMLParserDelegate,SA_OAuthTwitterControllerDelegate> {


IBOutlet UILabel *resultLabel;

IBOutlet UIButton *facebookButton;
IBOutlet UIButton *twitterButton;
IBOutlet UIButton *button3;
// .... other variables ...//

SA_OAuthTwitterEngine *_engine;
SA_OAuthTwitterController *controller;



}

/// .m

#pragma mark SA_OAuthTwitterControllerDelegate


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

    NSLog("@auth done with username : %@",username);

}

- (void) OAuthTwitterControllerFailed: (SA_OAuthTwitterController *) controller{

}

 - (void) OAuthTwitterControllerCanceled: (SA_OAuthTwitterController *) controller{

}

the crash happens before the NSLog of username, with "objc_msgSend" in Thread 1


Solution

  • Your log statement is incorrect, should be:

    NSLog(@"auth done with username : %@",username);