简体   繁体   English

在后台在目标C中填充表格单元格(iphone)

[英]Filling table cell (iphone) in objective C in background

I am displaying the data in table cell and I am downloading the data using the web service. 我在表格单元格中显示数据,并使用Web服务下载数据。
The data is huge, so it takes some time to download it and then display it. 数据量巨大,因此需要花费一些时间来下载并显示。
I need to provide some solution. 我需要提供一些解决方案。
I was thinking of downloading some data initially and then once the screen displays the information, then in the background will download rest of the data. 我当时想先下载一些数据,然后在屏幕上显示信息后,再在后台下载其余数据。
In this case the application will not look sluggish. 在这种情况下,应用程序不会显得迟钝。
If there is any other solution, please guide.. 如果还有其他解决方案,请指导。

Thank you! 谢谢!

You want to implement this code 您要实现此代码

static NSString *cellIdentifier = @"LeaveRequestTableViewCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if(cell == nil)
{
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle 
                                   reuseIdentifier:cellIdentifier] autorelease];
}

This will make your application fast as only the visible cells on the phone will be loaded. 这将使您的应用程序快速运行,因为只会加载手机上的可见单元格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM