I\'m using chcsvparser to parse data from a csv file on my apps launch. It\'s taking way too long to startup on main thread so I was thinking of doing this on the backgroun
You can always pass objects between threads.
Use the following code to create a thread and pass the object to it.
[NSThread detachNewThreadSelector:@selector(myThreadSelector:) toTarget:self withObject:myObject];
After the thread function is over you can pass the data back to the main thread using
[self performSelectorOnMainThread:@selector(myMainSelector:) withObject:myReturnObject waitUntilDone:NO];
you can pass the output NSArray from the parser to myMainSelector: and reload the tableview in it.
-(void)myMainSelector:(id)sender
{
NSArray *arr = sender;
tableDataArray = [NSArray arrayWithArray:arr];
[yourTableView reloadData];
}
You can show an activity indicator while you are in the thread method.