title: Objective-C accessing properties inside block
body: <p>I have read Apple's Blocks Programming Topics and my due diligence searching online, but I am still unclear if I am implementing my blocks correctly. I have an array of clients as a property that is populated when an NSNotification is sent. Clients is used as a tableview data source. The code below works, but I am curious if it is putting self in a retaining cycle. Should I do something like <code>__block id theClients = self.clients;</code> and then reference <code>theClients</code> inside the block?</p>
  
  <p><code>@property (strong, nonatomic) NSMutableArray *clients;</code></p>
  
  <pre><code>NSNotificationCenter *notifyCenter = [NSNotificationCenter defaultCenter];
  __block id observer = [notifyCenter addObserverForName:queryHash
                                                  object:nil
                                                   queue:[[NSOperationQueue alloc] init]
                                              usingBlock:^(NSNotification* notification){
                                                  // Explore notification
  
      if ([[notification.userInfo objectForKey:kdatasetReturnKey] objectAtIndex:0]) {
          NSArray *rows = [[notification.userInfo objectForKey:kdatasetReturnKey] objectAtIndex:0];
          if (self.clients)
          {
              self.clients = nil;
          }
          self.clients = [[NSMutableArray alloc] initWithCapacity:rows.count];
          for (NSDictionary *row in rows) {
              [self.clients addObject:row];
          }
      } else {
          NSLog(@"CLIENTS ERROR Returned: %@",[notification.userInfo objectForKey:kerrorReturnKey]);
      }
  
      [[NSNotificationCenter defaultCenter] removeObserver:observer];
  }];
  </code></pre>