在我的应用程序中,我试图加载一个总共80,000个文本“名称”的NSMutableArray,其工作完美,但当我们滚动整个滚动得到滞后(不平滑滚动)。基于UITableView中的可见单元格加载内容ios
所以我正在寻找任何方式将内容加载到UITableView中的可见单元格(以异步方式)。
这是我当前的代码
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1; //count of section
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// return [[copyGenericDetails valueForKey:@"name"]count]; //count number of row from counting array hear cataGorry is An Array
return [[bigArray valueForKey:@"Name"]count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *MyIdentifier = @"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:MyIdentifier];
}
cell.textLabel.text=[[bigArray valueForKey:@"Name"] objectAtIndex:indexPath.row];
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 40;
}
请帮我这个列表的滚动。
的UITableView加载唯一可见的细胞:
可以替换。不要一次传递80K记录。 – BhushanVU 2014-11-06 07:56:50