title: how do i allocate an NSMutableArray with a protocol?
body: <p>This is a newbie question. I have an object that looks like the following (e.g. <code>MyObject.h</code>).</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  #import "JSONModel.h"
  @protocol MyObject
  @end
  @interface MyObject : JSONModel
  @property (strong,nonatomic) NSString* name;
  @end
  </code></pre>
  
  <p>And the implementation looks like the following (e.g. <code>MyObject.m</code>).</p>
  
  <pre><code>#import "MyObject.h"
  @implementation MyObject
  @end
  </code></pre>
  
  <p>In my code elsewhere, I then define a <code>NSMutableArray</code> as follows.</p>
  
  <pre><code>NSMutableArray&lt;MyObject&gt;* list;
  list = [[NSMutableArray alloc] init];
  </code></pre>
  
  <p>And I get this warning.</p>
  
  <blockquote>
    <p>Incompatible pointer types assigning 'NSMutableArray&lt;MyObject&gt; <em>' from 'NSMutableArray</em>'</p>
  </blockquote>
  
  <p>I know from generics aren't supported out-of-the-box by Objective-C for collections (and that is not what I am trying to do here either), but my <code>NSMutableArray</code> is defined with such a protocol <code>MyObject</code> because I am <a href="https://github.com/icanzilb/JSONModel/blob/master/README.md" rel="nofollow">trying to follow the examples from "JSONModel's" GitHub page</a>. </p>
  
  <p>The code still compiles, but with the warning above. How do I </p>
  
  <ul>
  <li>make the warning go away, or</li>
  <li>allocate/initialize <code>NSMutableArray</code> correctly? </li>
  </ul>
  
  <p>Update:</p>
  
  <p>I continued to search how to get rid of that warning, and it turns out if I create a <code>NSMutableArray</code> like the following, the warning goes away (and project compiles without errors). I will write a unit test and see if it works as expected.</p>
  
  <pre><code>list = (id)[NSMutableArray new];
  </code></pre>