Web サービスからのデータを解析してテーブル ビューに表示するプロジェクトに取り組んでいます。すべて問題ありませんが、tableview のパフォーマンスに満足していません。Web からデータを解析した後、リロード データを呼び出してデータを表示しましたが、セルがすぐに表示されません。10/15 秒後のデータを表示します。データのリロードを呼び出す前に、すべてのデータがロードされていることを確認しました。奇妙なことに、テーブルをドラッグしようとするとすぐにセルが表示されます。
何か案が?
アップデート
-(void)receivedCategories:(NSMutableArray *)categoryItems{
[self.spinner stopAnimating];
self.categories=categoryItems;
if (self.tableView!=nil) {
[self.tableView reloadData];
}
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [self.categories count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"CategoryCell";
CategoryCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell.category = [self.categories objectAtIndex:indexPath.row];
return cell;
}
CategoryCell.m
@implementation CategoryCell
- (void)setCategory:(Category *)category
{
[self.categoryTitle setText:category.title ];
[self.categorySubTitle setText:category.description];
}
@end