1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Create an "Open on Startup" window.

Discussion in 'Mac Programming' started by the-dream, Sep 19, 2008.

  1. macrumors newbie

    Hi there.

    I want to create a window, with a checkbox in the bottom left. If the checkbox is unchecked, the window will display each time the application is launched, if it is checked, the window stops displaying on launch.

    I am relatively new to Mac application development, and couldn't find a tutorial anywhere, so a tutorial, or some sample code would really help.

    ~ Christian
  2. Moderator emeritus


    It's pretty simple. When the application launches, you check to see if the preferences contains a FirstRun object. If it doesn't, then you show the window. When the window closes and the checkbox is marked, you save a FirstRun object to preferences (usually a boolean set to true).

    Since you didn't give what API you're using I can only provide you the concept of how to implement it but that should be plenty enough.
  3. macrumors newbie

    I really am a noob when it comes to this, I know the bare basics but thats about it.

    I am using Cocoa/Obj-C CoreData. If thats any help?
  4. Moderator emeritus


    You need then to familiarize yourself with NSUserDefaults, NSWindow, and bindings (specifically NSUserDefaultsController).

Share This Page