• 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: Greg Guerin <email@hidden>
  • Date: Mon, 27 Apr 2009 10:30:23 -0700

David Scheidt wrote:

switch ([self tag]){

     case 0:  //catches the default IB Tag
	evenColor = uglyColor;
        break;
     case 1: // Foo Tables
	evenColor = FooColor;
	break;
    ....
    default:  // catches invalid tag in IB
       evenColor = uglyColor2;
   }
// drawing code follows ....


Assuming the tableviews have a different delegate type for Foo, Bar, or Quox, you could put an evenColor method in the delegate. Then check it with respondsToSelector: before messaging. The choice of evenColor then always changes with the delegate-type, regardless of tag value.

Just a thought.

  -- GG

_______________________________________________

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


  • Prev by Date: Re: figuring out which TableView I am?
  • Next by Date: Re: NSTask, or threading?
  • Previous by thread: Re: figuring out which TableView I am?
  • Next by thread: undoMenuTitleForUndoActionName
  • Index(es):
    • Date
    • Thread