Create an "Open on Startup" window.

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

  1. macrumors newbie

    Joined:
    Sep 19, 2008
    #1
    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.

    Thanks,
    ~ Christian
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    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. thread starter macrumors newbie

    Joined:
    Sep 19, 2008
    #3
    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

    kainjow

    Joined:
    Jun 15, 2000
    #4
    You need then to familiarize yourself with NSUserDefaults, NSWindow, and bindings (specifically NSUserDefaultsController).
     

Share This Page