我已经集成了 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");
}