I think this is an architectural problem. Tasks:
- editing toolbar
- fetchImonggoItemsDataIntoDocument
- do something else
If this needs to be done in order, then I do not quite understand the use of blocks or queues; just run the instructions one by one and you will be installed.
Otherwise, alternative # 1 would be to use dispatch_sync rather than dispatch_async . Again, I'm not quite sure what the use of the queue will be, but there is one.
Alternative # 2 would be to use a callback from a block. Sort of:
- (IBAction)refresh:(UIBarButtonItem *)sender { NSLog(@"checking"); [self editToolbar]; dispatch_queue_t fetchQ = dispatch_queue_create("Refreshing", NULL); dispatch_async(fetchQ, ^{ [self setupFetchedResultsController]; [self fetchImonggoItemsDataIntoDocument: self.itemDatabase]; [self doneChecking];
source share