title: How can I check if a struct has been initialized?
body: <p>I'm using an NSRange (a struct) and initializing it like this:</p>
  
  <pre><code>@interface MyViewController : UIViewController
  {
      NSRange currentRange;
  }
  </code></pre>
  
  <p>NSRange has a location and length field.</p>
  
  <p>How can I check to see if the struct has been initialized with a value? I tried:</p>
  
  <pre><code>if (myRange.length == nil)
  </code></pre>
  
  <p>but the compiler complained about comparing a pointer to an integer. Thanks.</p>