views:

356

answers:

3

I sorta understand better how what the MGTwitterEngine returns....I thought. But i'm still doing something wrong to get it into my table view. This is what I have in my cellforrowatindexpath method:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {


UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@"Default"];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"Default"] autorelease]; 
}
NSDictionary *record = [NSDictionary dictionaryWithContentsOfFile:[twitterEngine getUserTimelineFor:username since:nil count:20]];

cell.text = [record valueForKey:@"text"]; 

return cell;

}

What am I doing wrong? Thanks

A: 

getUserTimelineFor:since:count: does not return a list of tweets. It executes an asynchronous call that goes off and attempts to download the information. Whether or not this is successful is communicated to the object designated as the engine's delegate (and implements the MGTwitterEngineDelegateProtocol).

In other words, you need to understand the delegate pattern a bit more.

Dave DeLong
No Dave, I understand them fine, I just didn't look at them close enough.
Xcoder
A: 

I was totally overlooking the delegate methods and what they can do. MGTwitterEngine is more powerful than I initially thought. What worked was using the did get statusRecieved method to create an array from the returned array.

Xcoder