2009-07-29 41 views
0

我不知道MGTwitterEngine如何返回....我想。但是我仍然在做一些錯誤的事情,讓它進入我的表格視圖。這是我在我的cellForRowAtIndexPath方法:MGTwitterEngine和TableView

- (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; 

}

我在做什麼錯?謝謝

回答

0

getUserTimelineFor:since:count:不返回推文列表。它執行一個異步調用,並且嘗試下載信息。是否成功傳遞給指定爲引擎委託的對象(並實現MGTwitterEngineDelegateProtocol)。

換句話說,您需要更多地瞭解委託模式。

+0

沒有戴夫,我理解他們很好,我只是沒有看到他們足夠接近。 – Xcoder 2009-07-29 23:24:22

0

我完全忽略了委託方法以及他們可以做什麼。 MGTwitterEngine比我最初想象的更強大。有用的是使用did get statusRecieved方法從返回的數組中創建一個數組。