• 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: Dumb newbie question about objects and scalars
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dumb newbie question about objects and scalars


  • Subject: Re: Dumb newbie question about objects and scalars
  • From: John Stiles <email@hidden>
  • Date: Mon, 14 Mar 2005 15:54:20 -0800

More than ugly, the former wouldn't compile at all. Cases need to be constant values. A method call is no good.


On Mar 14, 2005, at 3:36 PM, Martin wrote:

I would leave your enum typedef intact and just box the values in NSNumbers when you need. So instead of the ugly:

switch ( [theBehavior intValue] )
    case [GLFreeform intValue]: {...}
    case [GLSlugline intValue]: {...}
    case [GLAction intValue]: {...}

You do:

    switch( [theBehavior intValue] )
        case GLCharacter: { ... }
        case GLParenthetical: { ... }

_______________________________________________ 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: 
 >Re: Dumb newbie question about objects and scalars (From: "Martin" <email@hidden>)

  • Prev by Date: Re: Web Services
  • Next by Date: Re: Training in Australia?
  • Previous by thread: Re: Dumb newbie question about objects and scalars
  • Next by thread: -[NSImage length]: selector not recognized
  • Index(es):
    • Date
    • Thread