• 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: Getting control IDs at initialization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting control IDs at initialization


  • Subject: Re: Getting control IDs at initialization
  • From: Uli Kusterer <email@hidden>
  • Date: Fri, 27 Jan 2006 13:13:05 +0100

Am 27.01.2006 um 07:11 schrieb Jeremy Hubbell:
I'd like to get all of the NSColorWell controller IDs

What's a "controller ID"?

 My guesses:

A controller is a class that manages interactions between a view and the model. An ID is an identification number. The former is a class *you* create, so just stuff a pointer to it in an instance variable or a global and you can access it with a name. ID numbers on view classes are usually called tags in Cocoa, and you can set up a tag in Interface Builder for the views that support that, and access/ change it by calling the -setTag: and -tag methods on that view. Is that what you meant?

on initialization and assign them static names. I've looked through the docs explaining @selectors and it seems that's where I need to be, but I'm unclear on the best implementation to discover and then assign at runtime. Is there a "best practices" way of accomplishing this?

A selector is simply the "name of a method" which you can use to stash it away in a data structure and call it later on several different objects. This has nothing to do with "naming" an object.


I have a nagging suspicion you actually meant NSControl instead of "controller" up there, and in that case my first guess would be you're actually looking for an IBOutlet.

Apple has lots of docs, but if none of this really makes sense to you, I'd suggest you get Aaron Hillegass' book on Cocoa programming on Mac OS X (the one he wrote alone, not the advanced one). It explains all those basics way better than Apple's docs on the web site. OTOH, you'll want to try reading the books on Apple's web site and do some of the introductory tutorials, too. They're worse than Hillegass' but still useful.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Getting control IDs at initialization (From: Jeremy Hubbell <email@hidden>)

  • Prev by Date: Re: NSCursor Resize Cursor
  • Next by Date: Re: Apple Finder team is hiring
  • Previous by thread: Getting control IDs at initialization
  • Next by thread: NSTextStorage subclass
  • Index(es):
    • Date
    • Thread