title: iPhone - Different Default Boolean Value on Device
body: <p>I've recently had a bit of code work perfectly on the simulator, and screw up on device. Why? - It's very simple, but I can't explain the explantion.</p>
  
  <p>I did a little testing, by creating a new view-based app, added a label and an outlet for the label, and wrote this code in the viewDidLoad:</p>
  
  <pre><code>BOOL b;
  if (b) {
      label.text = @"Value = YES";
  }
  else {
      label.text = @"Value = NO";
  }
  </code></pre>
  
  <p>Interestingly enough, here are the results:</p>
  
  <blockquote>
    <p>iOS Simulator (4.2): Value = NO<br/> iOS Simulator (4.3): Value = NO<br />iPod Touch 2G (4.2.1) Value = YES<br />iPhone 3G (4.2.1) Value = YES</p>
  </blockquote>
  
  <p>What does this suggest? - Well to me it looks like that on devices, the default boolean value is YES, and on the simulator, the default boolean value is NO.</p>
  
  <p>Can anyone clarify if this is the case? Also if someone could explain that behavior I would be very interested. </p>
  
  <p>I am <strong>not</strong> interested in solutions to the problem, clearly it can be solved by setting the desired default (in my case <code>NO</code>) manually.</p>
  
  <p>Thanks.</p>