title: Trouble filtering array of custom objects by an NSNumber using NSPredicate
body: <p>This should be straightforward but something is preventing me from filtering an array of custom objects by NSNumber using NSPredicate. Perhaps it has something to do with the datatype when converting from JSON but I can't figure it out.</p>
  
  <p>I download data from a JSON in an array of custom Objects that look like:</p>
  
  <pre><code>{"hid":"47","public":"1"}
  </code></pre>
  
  <p>The code to parse the JSON looks like:</p>
  
  <pre><code> if (feedElement[@"public"] &amp;&amp; ![feedElement[@"public"] isEqual:[NSNull null]]) {
              newMyObject.pub = feedElement[@"public"]== nil ? @"0" : feedElement[@"public"];}
  </code></pre>
  
  <p>The object looks like:</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  NS_ASSUME_NONNULL_BEGIN
  @interface MyObject : NSObject
  @property (nonatomic, retain) NSNumber * hid; 
  @property (nonatomic, retain) NSNumber * pub;
  @end
  NS_ASSUME_NONNULL_END
  </code></pre>
  
  <p>The objects are placed in an NSArray * myObjects</p>
  
  <p>My NSPredicate and filter code looks like:</p>
  
  <pre><code>NSPredicate *pubPred = [NSPredicate predicateWithFormat:@"pub == 1"];
  NSArray *filteredArray = [myObjects filteredArrayUsingPredicate:pubPred];
  </code></pre>
  
  <p>When I log <code>[myObjects valueForKey:@"pub"]</code>, it logs as 1,1,1, etc. so I know that the values for pub are all 1 however the resulting <code>filteredArray</code> is empty.</p>
  
  <p>What could be wrong with my code?</p>
  
  <p>Thanks for any suggestions.</p>
  
  <p><strong>Edit</strong>: I changed public to pub in the object in case public was a reserved word but it did not change anything</p>