title: How to check for null value in NSNumber
body: <p>First off I confess my ignorance, I've learned everything I know about Objective-C in the few months I've been working on my project. I also find it utterly frustrating how Objective-C seems to complicate what would be simple matters in any other language I've worked with. This question is a case in point...</p>
  
  <p>In the first run my app downloads a bunch of JSON which it uses to populate a CoreData store. I use an Obj-C/JSON library (CJSONDeserializer) to convert the JSON to NSArrays. In the JSON download for one CoreData entity there's a field containing a number (<code>"show_id":2</code>) identifying the related field in another entity if there is one or null (<code>"show_id":null</code>) otherwise. In processing that field I assign it to an NSNumber using...</p>
  
  <pre><code>NSNumber *shoIndex = [[item objectForKey:typeKey] objectForKey:@"show_id"];
  </code></pre>
  
  <p>I then try to check that I have a valid number before attempting to fetch &amp; link the related record so as to not do wasteful processing where there is no related record.</p>
  
  <p>Interrogating <code>shoIndex</code> with...</p>
  
  <pre><code>NSLog(@"shoIndex: %i, %@, %@", shoIndex, shoIndex, [shoIndex description]);
  </code></pre>
  
  <p>Gives...</p>
  
  <pre><code>shoIndex: 19590600, &lt;null&gt;, &lt;null&gt;
  </code></pre>
  
  <p>where the JSON value was <code>null</code> &amp;...</p>
  
  <pre><code>shoIndex: 228300880, 51, 51
  </code></pre>
  
  <p>otherwise.</p>
  
  <p>So far the only successful check I've made is with...</p>
  
  <pre><code>if (![[shoIndex description] isEqualToString:@"&lt;null&gt;"]) {
  </code></pre>
  
  <p>Can anyone suggest a better way?</p>
  
  <p>Update...</p>
  
  <p>Looking at it another way <code>shoIndex</code> is assigned as a <code>NSNumber</code> that sometimes contains a <code>NSString</code> value <code>@"&lt;null&gt;"</code>. Does Obj-C have something like an <code>isa</code> operator that I could use to check the type of the contents of <code>shoIndex</code>?</p>
  
  <p>TIA, Pedro.</p>