1

我已经集成了 MGTwittweEngine 以获取 twitter 页面的提要以显示在我的应用程序的 tableview 中。这件事从 2 个月开始工作,但从 6 月 1 日开始它已经停止工作。请建议我的代码出了什么问题。

in viewdidload I am calling

feed_count = 30;
    [self setTweets:[[NSMutableArray alloc]init]];
    twitterEngine = [[MGTwitterEngine alloc] initWithDelegate:self];
    [twitterEngine setUsesSecureConnection:NO];
    [twitterEngine setUsername:@"GoodLifeFitness"];
    [twitterEngine getUserTimelineFor:[twitterEngine username] sinceID:0 startingAtPage:1 count:feed_count];

#pragma mark - MGTwitterEngineDelegate -

- (void)requestSucceeded:(NSString *)connectionIdentifier{
    NSLog(@"request successfull for connection :%@",connectionIdentifier);

}
- (void)requestFailed:(NSString *)connectionIdentifier withError:(NSError *)error{
    NSLog(@"request successfull for connection :%@",connectionIdentifier);

}
- (void)statusesReceived:(NSArray *)statuses forRequest:(NSString *)connectionIdentifier{
    //[Shared hideProgressHud];
    NSLog(@"status received");
    for (NSDictionary *dict in statuses) {
        NSString *text = [dict objectForKey:@"text"];
        NSString *screenName = [[dict objectForKey:@"user"] objectForKey:@"screen_name"];
        NSString *profileImageIdentifier = [twitterEngine getImageAtURL:[[dict objectForKey:@"user"] objectForKey:@"profile_image_url"]];

        Tweet *tweet = [[Tweet alloc] init];
        [tweet setText:text];
        [tweet setScreenName:screenName];
        [tweet setProfileImageIdentifier:profileImageIdentifier];
        [[self tweets] addObject:tweet];
    }
    [[self feedTableView] performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];

}
- (void)imageReceived:(UIImage *)image forRequest:(NSString *)connectionIdentifier{
    for (int i = 0; i < [[self tweets] count]; i ++) {
        Tweet *tweet = [[self tweets] objectAtIndex:i];
        NSLog(@"image received");
        if ([connectionIdentifier isEqualToString:[tweet profileImageIdentifier]]) {
            [tweet setProfileImage:image];
            [[self tweets] replaceObjectAtIndex:i withObject:tweet];
            [[self feedTableView] performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
        }
    }
}
-(void)connectionStarted:(NSString *)connectionIdentifier{
    NSLog(@"connection started");
}
-(void)connectionFinished:(NSString *)connectionIdentifier{
    NSLog(@"connection finished");
}
4

1 回答 1

1

单击此处这是最新且管理良好的图书馆。您可以在其中获取所有推文、关注者和所有信息

于 2013-06-14T11:24:35.243 回答