Question

An App interface has an UISegmentedControl on the top of screen and a UITableView of the rest of the screen.

When UiSegmentedControl gets a click then NSFetchedController gets an update for NSPredicate of NSFetchRequest and perform a performFetch method.

Because, it's take a 4 seconds to take a result I would like to reload a tableview to display 0 sections and after the result is ready then reload a tableView.

how to do it ?

Was it helpful?

Solution

- (void)viewDidLoad
{
    [super viewDidLoad];

    [self performSelectorInBackground:@selector(exercisedata) withObject:nil];

}


-(void)exercisedata
{
    [self performSelectorOnMainThread:@selector(ProcessComplete) withObject:nil waitUntilDone:NO];
}
-(void)ProcessComplete
{
    [tbl reloadData];
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top