2013-07-02 56 views
1

在我的應用程序中,我想從twitter獲取下列/ follower朋友的列表。在Twitter中整合Twitter sdk

眼下,我只能夠獲取的追隨者而不是以下的名稱& ID。

我的代碼如下:

-(void) getTwitterFriendsIDListForThisAccount{ 

    NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/followers/ids.json"]; 

    NSDictionary *p = [NSDictionary dictionaryWithObjectsAndKeys:myAccount.username, @"screen_name", nil]; 

    TWRequest *twitterRequest = [[TWRequest alloc] initWithURL:url parameters:p requestMethod:TWRequestMethodGET]; 

    [twitterRequest setAccount:myAccount]; 
    [twitterRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResposnse, NSError *error) 
    { 
     if (error) { 

     } 
     NSError *jsonError = nil; 
     // Convert the response into a dictionary 
     NSDictionary *twitterFriends = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONWritingPrettyPrinted error:&jsonError]; 

     NSArray *IDlist = [twitterFriends objectForKey:@"ids"]; 

     NSLog(@"response value is: %@", IDlist); 
} 

我怎樣可以得到下面的列表IDS?以及email_ids,如果可能的話。

有時會顯示遷移錯誤。如何從1.0遷移到1.1?

謝謝

回答

0

這是最好的解決方案之一:只要下載Sharekit,並按照循序漸進

ShareKit ShareKit

,看到SHKTwitter.h和SHKTwitter.m文件,您可以得到它。

其易