title: block callbacks -- when original object is deallocated
body: <p>I'm calling my DatabaseManager to save an object created in a viewController like so:</p>
  
  <pre><code>  [DatabaseManager addUniqueObject:fooChild key:[fooParent fooChildKey] toObject:self.foo callback:^(BOOL succeeded, NSError *error) {
  
  
              if (error) {
                  [[UIApplication sharedApplication] endBackgroundTask:self.sendBackgroundTaskId];
                  return;
              }
  
  
                 [self.tableView reloadData];
                 [self scrollToBottomAnimated:YES];
              }
  
              [[UIApplication sharedApplication] endBackgroundTask:self.sendBackgroundTaskId];
          }];
  </code></pre>
  
  <p><code>addUniqueObject</code> is a class method in my DatabaseManager (I'm using Parse as the backend as you can see):</p>
  
  <pre><code> + (void)addUniqueObject:(PFObject*)uniqueObject key:(NSString*)key toObject:(PFObject*)object callback:(void(^)(BOOL succeeded, NSError *error))callback {
  
      if (uniqueObject) {
          [PFCloud callFunctionInBackground:@"addUniqueObjectToObject"
                             withParameters:@{@"classKey":[object parseClassName],
                                              @"objectId":[object objectId],
                                              @"keyToAdd":key,
                                              @"objectToAddClassKey":[uniqueObject parseClassName],
                                              @"objectToAddId":[uniqueObject objectId],
  
                                              }
                                      block:^(NSMutableDictionary *results , NSError *error) {
                                          if (!error) {
                                              callback(YES, error);
                                          }
                                          else {
                                              callback(NO, error);
                                          }
                                      }];
      }
  
  }
  </code></pre>
  
  <ol>
  <li><p>First question - So if I create this object but then navigate away and thus pop this VC before the save executes, then <code>self.tableView</code> or any other property I'm referencing in the completion block is <code>nil</code> at this point, correct?</p></li>
  <li><p>Second question - I passed the completion block to the DatabaseManager - does this completion object still exists if the original VC is destroyed? Do I have to check for existence of this block before I execute <code>callback()</code>?</p></li>
  </ol>
  
  <p>This doesn't seem to cause any problems for me, so I hadn't questioned it until now. But I'd like to understand.</p>