title: Checkbox setState:0 on app launch
body: <p>I'm having a problem with a checkbox. I want to set it to 0 (unchecked) on app launch, but the checkbox is controlled by another class "myClass" for example.</p>
  
  <p>Here's what I did:</p>
  
  <ul>
  <li>I opened Interface Builder and put a checkbox (NSButton) in my window, dragged NSObject in my MainMenu.xib window, renamed it to say "myClass". Added an outlet called "myCheckbox" (NSButton) and linked it to the checkbox I created earlier. Finally, I added some things.</li>
  </ul>
  
  <p>Here's the code for my myClass.m:</p>
  
  <pre><code>#import "myClass.h"
  
  @implementation myClass
  
  - (void) changeState
  {
      [myCheckbox setState:0];
  }
  
  @end
  </code></pre>
  
  <p>myClass.h</p>
  
  <pre><code>#import &lt;Cocoa/Cocoa.h&gt;
  
  @interface myClass : NSObject {
      IBOutlet NSButton *myCheckbox;
  }
  
  - (void) changeState;
  
  @end
  </code></pre>
  
  <p>Then I made some changes in the AppDelegate files so they execute some things when the app is launched:</p>
  
  <pre><code>#import "UntitledAppDelegate.h"
  #import "myClass.h"
  
  @implementation UntitledAppDelegate
  
  @synthesize window;
  
  - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
      myClass * someClass = [[myClass alloc] init];
  
      [someClass changeState];
  }
  
  @end
  </code></pre>
  
  <p>UntitledAppDelegate.h:</p>
  
  <pre><code>#import &lt;Cocoa/Cocoa.h&gt;
  
  @interface UntitledAppDelegate : NSObject &lt;NSApplicationDelegate&gt; {
      NSWindow *window;
  }
  
  @property (assign) IBOutlet NSWindow *window;
  
  @end
  </code></pre>
  
  <p>The purpose (if this works) is to set a value to the check box depending on the setting stored in the Defaults file.</p>
  
  <p>The problem might be easy or too simple but I'm only a beginner...</p>
  
  <p>Some help would be appreciated, Thanks !</p>