• 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: Jim Correia <email@hidden>
  • Date: Sun, 26 Apr 2009 19:31:16 -0400

On Sun, Apr 26, 2009 at 7:05 PM, WT <email@hidden> wrote:

> More importantly, perhaps, is the fact that adding property/ivars is not a
> scalable solution in that it requires adding more code in several places if
> more tables are added. The tags solution only requires some fiddling with IB
> and updating a switch statement. That sounds to me a much simpler
> maintenance problem than having to update code in several places.

I guess I'm not following your logic.

I want table 1 to have a blue background, so I set its tag to 3.
I want table 2 to also have a blue background, so I set its tag to 3.

I want table 1 to have red text. Switch off tag, 3 == red text.
I want table 2 to have green text. Oops - tag 3 already means blue
background + red text.

(Substitute any 2 actual properties for my background color + text
color - they are meant for illustration purposes only.)

Overloading tags for other properties is not scalable, because you
only have one property (the tag) which you are overloading to mean N
other properties and/or behaviors.

The only scalable solution to this problem is explicity
iVars/properties for each property/behavior you want to control in
your subclass. (Yes, this means configuring things by hand after
unarchiving your nib, or writing an IB plug-in so you can specify them
in IB.)

- Jim
_______________________________________________

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>
    • Re: figuring out which TableView I am?
      • From: Graham Cox <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>)

  • Prev by Date: Core Data Suddenly Losing Changes
  • Next by Date: Re: figuring out which TableView I am?
  • Previous by thread: Re: figuring out which TableView I am?
  • Next by thread: Re: figuring out which TableView I am?
  • Index(es):
    • Date
    • Thread