title: AFNetworking - Build NSDictionary parameters
body: <p>I'm trying to build my <code>NSDictionnary</code> to send to a request using the AFNetworking framework, but it seems that I'm quite confused about how to do it properly.</p>
  
  <p>Here's what the server is expecting :</p>
  
  <pre><code>{
      "limit":10,
      "filters":
      [
          {"field":"owner","operator":"EQUAL","value":"ownerId","type":"integer"},
          {"field":"date","operator":"GE","value":"30 Jun 2010 00:00:00","type":"date"},
      ],
      "order":[{"field":"date","order":"ASC"}],
      "page":0
  }
  </code></pre>
  
  <p>What I'm trying to do (I don't really know if it's the right way to do it tbh), is to build a NSDictionary like the following :</p>
  
  <pre><code>NSDictionary *parameters = [NSDictionary dictionaryWithObjectsAndKeys:
                                  @"10", @"chunkSize", 
                                  [NSDictionary dictionaryWithObjectsAndKeys:
                                      [NSDictionary dictionaryWithObjectsAndKeys:@"owner", @"field", @"EQUAL", @"operator", @"ownerId", @"value", @"integer", @"type", nil],
                                      [NSDictionary dictionaryWithObjectsAndKeys:@"date", @"field", @"GE", @"operator", @"30 Jun 2010 00:00:00", @"value", @"date", @"type", nil],
                                      nil], @"filters",
                                  [NSDictionary dictionaryWithObjectsAndKeys:
                                      [NSDictionary dictionaryWithObjectsAndKeys:@"date", @"field", @"ASC", @"order", nil],
                                      nil], @"order",
                                  @"0", @"page",
                                  nil];
  </code></pre>
  
  <p>But I have the following error when the view is loading :</p>
  
  <pre><code>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
  reason: '+[NSDictionary dictionaryWithObjectsAndKeys:]: second object of each pair must be non-nil
  </code></pre>
  
  <p>I know I screw up building the parameters properly, but I can't manage to do it after several tries. Could anyone help ? Moreover, I don't really know the differences that I must implement here with the <code>[]</code> and the <code>{}</code>. I read that <code>{}</code> was for a dictionary and <code>[]</code> for an array, but I don't really see how to translate it in my case.</p>