title: BOOL is returning YES for value 0 in objective-c?
body: <p>I have <code>Invisible = 0</code> in my model and I am trying get this in <code>BOOL</code> using this line. </p>
  
  <pre><code>BOOL invisible = [self.model objectForKey:@"Invisible"];
  </code></pre>
  
  <p>but invisible is YES instead of NO. I've also tried with bool but it is also true. I checked class of the object using <code>[[self.model objectForKey:@"Invisible"] class]</code> and it is showing _NSCFBoolean. What's wrong here? model is NSDictionary.</p>
  
  <p><a href="https://i.stack.imgur.com/Hmm20.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hmm20.png" alt="enter image description here"></a></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Okay so I found the real issue. I have Filter class where I have getter isInvisible and code is</p>
  
  <pre><code>- (BOOL)isInvisible {
       return [[self.model objectForKey:@"Invisible"] boolValue]; 
     }
  </code></pre>
  
  <p>When I call this first time it returns me NO. Which is good. Now immediately after that I call it again and it returns &lt;nil>. Strange. </p>
  
  <pre><code>(lldb) po filter.isInvisible 
  NO 
  (lldb) po filter.isInvisible 
  &lt;nil&gt;
  </code></pre>
  
  <p>There is only 1 second difference between two po commands.</p>