• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Class Design for delegate, outlets, and mouse events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Class Design for delegate, outlets, and mouse events


  • Subject: Re: Class Design for delegate, outlets, and mouse events
  • From: Shlok Datye <email@hidden>
  • Date: Tue, 26 May 2009 22:11:05 +0000

To determine whether the app is launching for the first time, you can put a boolean called "firstLaunch" into the user defaults. It would have a factory default of YES and could be changed to NO inside of applicationDidFinishLaunching:.

As for the buttons, are you sure you want to detect mouse events on them? Will setting their targets and actions, and possibly determining which button was clicked using the actions' "sender" arguments, not suffice? If not, I believe you will have to subclass NSButton to override the mouse event-handling methods.

Shlok Datye
Coding Turtle
http://codingturtle.com


On 26.05.2009, at 20:47, Walker Argendeli wrote:

Here's a simplification:

I have an application with several buttons. If it is the first time the application is launching, I want to do some special things. In my AppController class, which is a delegate of NSApp, I use the delegate method -applicationDidFinishLaunching: to perform the test. After I've detected that it is the first time, I first want to access some IBOutlets. Then, I'd like to be able to get mouse events for each button, so that I can do other things.

I can't figure out want to do with the classes. I'd like to make a new class (FirstLaunch) for the first launch, but I'm not sure what to call from AppDelegate. Also, to get mouse events, shouldn't I be a sublass of the buttons, and considering that I have multiple buttons, I'm confused. I could probably tackle these issues one-by- one, but taken all together, they're confusing me.

Broken down, I need to access & manipulate IBOutlets I have set in IB, determine when buttons are clicked (and which button was clicked). I'd like to be able to do this from another class so as to not clutter up the AppDelegate.

Thanks for the help!


- Walker Argendeli


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Class Design for delegate, outlets, and mouse events (From: Walker Argendeli <email@hidden>)

  • Prev by Date: Re: Recommendations to Reading the Xcode in built Documentation to the fullest effect
  • Next by Date: Re: NULL Outlets in one file work in another
  • Previous by thread: Class Design for delegate, outlets, and mouse events
  • Next by thread: Bound NSPopUpButton + null at the beginning
  • Index(es):
    • Date
    • Thread