我们可以线程的Web服务,并在自定义表格单元格中插入?

事情是我必须使自定义单元格的UITable,我不得不调用大量的Web服务与许多数据,这将需要更长的时间来加载一次。 所以我想申请线程。 现在我的问题是。 我们可以在运行时将自定义单元格中的值逐个插入,就像用户在运行时会看到数据一个接一个的一样。 如果是的话,我们可以做到这一点。

是的,你可以…试试这个

- (void)viewDidLoad { myApp = (myAppDelegate *) [[UIApplication sharedApplication] delegate]; [self performSelectorInBackground:@selector(startParsing) withObject:nil]; [super viewDidLoad]; } - (void) startParsing { [self performSelectorOnMainThread:@selector(startIndicator) withObject:nil waitUntilDone:NO]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSURL *url = [[NSURL alloc] initWithString:@"http://abc.com"]; NSData *data = [NSData dataWithContentsOfURL:url]; // 2 -- parsing parser = [[VolMyParser alloc] init]; [parser parseXML:data]; [data release]; //[parser print]; [self performSelectorOnMainThread:@selector(updateTable) withObject:nil waitUntilDone:NO]; [pool release]; } - (void) startIndicator { av.hidesWhenStopped = YES; [av startAnimating]; } - (void) updateTable { [av stopAnimating]; [myTable reloadData]; } 

希望它给你一个想法…