I have an ipad app that is loading data remotely into core data, I was to constantly display a status update to a label but it looks like everything in my method has to be completed before the message is sent to the UILabel.
How do I get around this?
Sample Code:
-(void) importCollections {
/* code left out for brevity */
for (int j=0; j <[[myCollections objectAtIndex:i] count]; j++)
{
Collection *entity = (Collection*) [NSEntityDescription insertNewObjectForEntityForName:@"Collection" inManagedObjectContext:managedObjectContext];
[entity setCollectionName:[[[myCollections objectAtIndex:i] objectAtIndex:j] valueForKey:@"CollectionName"]];
[entity setCollectionID:[[[myCollections objectAtIndex:i] objectAtIndex:j] valueForKey:@"CollectionID"]];
[entity setManufacturer:[manufacturers objectAtIndex:i]];
NSError *error;
if (![managedObjectContext save:&error]) {
// Handle the error.
NSLog(@"%@",error);
}
importStatus.text =[NSString stringWithFormat:@"importing collection: %@", entity.CollectionName];
}
}
In the code above the importStatus is the UILabel I need to update constantly, but it seems to wait until after everything in this method is completed.