• 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: figuring out which TableView I am?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: figuring out which TableView I am?


  • Subject: Re: figuring out which TableView I am?
  • From: "Adam R. Maxwell" <email@hidden>
  • Date: Mon, 27 Apr 2009 07:42:43 -0700


On Apr 27, 2009, at 2:10 AM, WT wrote:

On Apr 25, 2009, at 6:47 PM, David Scheidt wrote:

I've got a sub-class of NSTableView. I have windows that have more than one instance of this TableView in them, which need to behave slightly differently, based on which one they are.

The way I understood his question, this is a problem of *identifying* instances. At some point or points in his code, he's got a pointer to an instance of his subclass of NSTableView and needs to be able to determine which of several instances that is. I still maintain that if these instances have different tag values then

My understanding wants to do this from a tableview subclass, though:

switch([self tag]) {
	case 1:
		return ...
	case 2:
		return ...
}

...so the tag is truly being used as a container for a property, which it doesn't sound like you intended? I don't think using tags from a controller class is a bad solution, although my own preference would be to have something like Jon/Mike/Jim suggested. Using the tag from the tableview subclass seems like a poor design, IMO, and not easy to maintain or extend.

--
Adam

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: figuring out which TableView I am?
      • From: WT <email@hidden>
References: 
 >figuring out which TableView I am? (From: David Scheidt <email@hidden>)
 >Re: figuring out which TableView I am? (From: WT <email@hidden>)
 >Re: figuring out which TableView I am? (From: David Scheidt <email@hidden>)
 >Re: figuring out which TableView I am? (From: WT <email@hidden>)
 >Re: figuring out which TableView I am? (From: David Scheidt <email@hidden>)
 >Re: figuring out which TableView I am? (From: Jonathan Hess <email@hidden>)
 >Re: figuring out which TableView I am? (From: WT <email@hidden>)
 >Re: figuring out which TableView I am? (From: Jim Correia <email@hidden>)
 >Re: figuring out which TableView I am? (From: Graham Cox <email@hidden>)
 >Re: figuring out which TableView I am? (From: Michael Ash <email@hidden>)
 >Re: figuring out which TableView I am? (From: WT <email@hidden>)

  • Prev by Date: Re: NSDateFormatter bug in timeZone
  • Next by Date: Re: Scheduling application
  • Previous by thread: Re: figuring out which TableView I am?
  • Next by thread: Re: figuring out which TableView I am?
  • Index(es):
    • Date
    • Thread