title: running operation in background thread and have a completion block?
body: <p>I have a task which is reading from a disk, potentially going to take quite some time, so don't want to do it in a main thread.. and what I want is to call a function X after reading from the disk. What is the best way to do this in iOS?</p>
  
  <p>So far this is what I've tried:</p>
  
  <pre><code> NSInvocationOperation *processDataOperation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(readDisk:) object:nil];
                  [processDataOperation setQueuePriority:NSOperationQueuePriorityVeryHigh];
                  [processDataOperation setCompletionBlock:^(void){
                       NSMutableArray *feedItemsArray = [self generateFeedItemsFromDictionary:streamDiskData];
                       [self postFetchCompletedNotificationForDict:queryStringDict withFeedItems:feedItemsArray isFresh:NO];
                  }];
  </code></pre>
  
  <p>basically I am using NSInvocationOperation and then set it's completion block, however the issue is that in my completion block I need the result that is generated in readDisk. How do I access that in the completion block? It's nearly imposible right?</p>