2009-07-29 9 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 : 이후 : 개수 : 트윗 목록을 반환하지 않습니다. 비동기 호출을 실행하고 정보를 다운로드하려고 시도합니다. 이것이 성공했는지 여부는 엔진의 위임자로 지정된 객체에 전달됩니다 (MGTwitterEngineDelegateProtocol 구현).

즉, 위임 패턴을 좀 더 이해해야합니다.

+0

아니요, Dave는 아닙니다. 나는 그 사실을 잘 알고 있으며, 충분히 가까이에서 보지 않았습니다. – Xcoder

0

전 대리인 방법을 완전히 간과하고 있습니다. MGTwitterEngine은 처음 생각한 것보다 훨씬 강력합니다. 무엇이 성공했는지는 statusRecieved 메소드를 사용하여 리턴 된 배열에서 배열을 작성하는 것입니다.