2011-09-06 5 views
0

나는 RSS 게시물 jQuery과에로드 한 및 게시물의 수는이 방법에 의해 결정됩니다UITableView 하단에 더 많은 RSS 게시물을로드 하시겠습니까?

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 
    if (rss.loaded == YES) { 
     return [rssItems count]*2; 
    } else { 
     return 1; 
    } 
} 

가 어떻게 바닥을 치고 이후의 tableview에 게시물을로드 할 수 있을까?

답변

0

마지막 셀이로드 될 때 트리거 할 수 있습니다.

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 
    . 
    . 
    . 
    if (allForecastObjects.count == indexPath.row+1) { 
     [self getAndAppendMoreData]; 
    } 
} 

-(void)getAndAppendMoreData { 

    //this kicks of a preferably asynchronous call for data 
    //after new data is added to array/collection reload table view 

} 

-(void)getAndAppendMoreDataCompleted { 

    if (success) { 
     [yourTableView reloadData]; 
    } 

} 

희망이 있습니다.

관련 문제