2011-11-21 29 views
1

,當我嘗試在Twitter上分享我做以下步驟Twitter的SDK的iPad,在Twitter上登錄weired錯誤

if (!twitterEngine) 
{ 
    twitterEngine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate: self]; 
    twitterEngine.consumerKey = kOAuthConsumerKey; 
    twitterEngine.consumerSecret = kOAuthConsumerSecret; 

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

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

後,我得到了Twitter的登錄視圖後,我把我的傳球和用戶,然後單擊添加應用

我得到asembly代碼,我沒有錯誤消息崩潰,但我看到的東西我也weiered在代表

- (void) OAuthTwitterController: (SA_OAuthTwitterController *) controller authenticatedWithUsername: (NSString *) username { 
    NSLog(@"Authenicated for %@", username); 
    [self postTwitterStatus]; 
} 

是authintication成功,但我得到的第在用戶名== NULL

我怎麼能解決這個問題

感謝

回答

3

我沒有得到這個錯誤,但類似一個使用Twitter + OAuth的由Ben戈特利布。如果你使用這個東西,它需要使用https而不是http連接到twitter。 去:SA_OAuthTwitterEngine.m和更改爲:

- (SA_OAuthTwitterEngine *) initOAuthWithDelegate: (NSObject *) delegate { 
    if (self = (id) [super initWithDelegate: delegate]) { 
     //CHANGED FROM 'HTTP' TO 'HTTPS': 
     self.requestTokenURL = [NSURL URLWithString: @"https://twitter.com/oauth/request_token"]; 
     self.accessTokenURL = [NSURL URLWithString: @"https://twitter.com/oauth/access_token"]; 
     self.authorizeURL = [NSURL URLWithString: @"https://twitter.com/oauth/authorize"]; 
    } 
    return self; 
} 

試試看,我不知道它是與您的問題..

+0

男人你很棒,:D – user784625

0

每一件事看起來好像沒什麼問題。請檢查此example並查看您在此獲取用戶名的天氣。