title: "variable is not assignable (missing __block type specifier)" error when using a variable from method declaration in method block
body: <p>I'm developing a small iOs application which retrieves information from a server, and I found the pretty useful NSURLSessionDataTask.
  First I used a <code>@property (nonatomic, strong) NSMutableArray *objectArray;</code>
  which I called in my method: </p>
  
  <pre><code>    - (void) createObjectsArrayFromUrl: (NSString *) url {
  NSURL *URL = [NSURL URLWithString:url];
  NSURLRequest *request = [NSURLRequest requestWithURL:URL];
  NSURLSession *session = [NSURLSession sharedSession];
  NSURLSessionDataTask *task = [session dataTaskWithRequest:request
                                          completionHandler:
                                ^(NSData *data, NSURLResponse *response, NSError *error) {
                                    if(error) {
                                        //error handling
                                    }
                                    dispatch_async(dispatch_get_main_queue(), ^{
  
                                       NSMutableDictionary *jsonDataDictionary = [objectModel getJsonData];
  
                      self.objectArray = [objectModel arrayFromDictionary:jsonDataDictionary];
  
                                        [[self collectionView] reloadData];
  
                                    });
                                }];
  [task resume];
  }
  </code></pre>
  
  <p>And it all went smooth.
  Now I want to create a universal method, for more arrays, and I thought to do it  by passing the array to the method, and updating it inside, like this:</p>
  
  <pre><code>- (void) createObjectsArrayFromUrl: (NSString *) url inArray: (NSMutableArray *) objectArray{
      NSURL *URL = [NSURL URLWithString:url];
      NSURLRequest *request = [NSURLRequest requestWithURL:URL];
      NSURLSession *session = [NSURLSession sharedSession];
      NSURLSessionDataTask *task = [session dataTaskWithRequest:request
                                              completionHandler:
                                    ^(NSData *data, NSURLResponse *response, NSError *error) {
                                        if(error) {
                                            //error handling
                                        }
                                        dispatch_async(dispatch_get_main_queue(), ^{
  
                                           NSMutableDictionary *jsonDataDictionary = [objectModel getJsonData];
  
                          objectArray = [objectModel arrayFromDictionary:jsonDataDictionary];
  
                                            [[self collectionView] reloadData];
  
                                        });
                                    }];
      [task resume];
      }
  </code></pre>
  
  <p>but it gives me the error in the title in the following line: <code>objectArray = [objectModel arrayFromDictionary:jsonDataDictionary];</code> and I don't know how to proceed.
  So my idea is, instead of creating a method for every array I have, like before, I want to pass the array as a variable and update it in the method. 
  How to achieve this?
  Thanks.</p>