Objective-C: Asynchronously populate UITableView - how to do this?

前端 未结 3 1944
心在旅途
心在旅途 2020-12-07 10:06

I can\'t seem to find any info on this question, so I thought I\'d ask the community.

Basically, I have a UITableView and I want to show an activity indicator while

3条回答
  •  Happy的楠姐
    2020-12-07 10:52

    This is the problem

    request setCompletionBlock:^{
            self.listData = [[NSArray alloc] initWithObjects:@"Red", @"Green", @"Blue", @"Indigo", @"Violet", nil];   //this doesn't work...
            [table performSelectorOnMainThread:@selector(reloadTable) withObject:nil waitUntilDone:NO];    
        }];
    

    The reload table needs to be done on the main thread.

提交回复
热议问题