• 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: NSStringFromClass versus className ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSStringFromClass versus className ?


  • Subject: Re: NSStringFromClass versus className ?
  • From: Mike Abdullah <email@hidden>
  • Date: Wed, 27 Feb 2008 12:17:13 +0000

Right, clearly you should use that for testing a class. But, what if you want to record the classname so you can instantiate another one or similar later?

Mike.

On 20 Feb 2008, at 23:37, Kyle Sluder wrote:

On Wed, Feb 20, 2008 at 1:23 PM, Mike Abdullah
<email@hidden> wrote:
With this I suspect that NSStringFromClass() will return the dynamic
class name which will be different to what your code might expect. -
className I believe will still return your object's intended class.

Regardless of whether or not this is the case, keep in mind that you should always be testing for object class using the NSObject protocol methods -isKindOfClass: (allows for inheritance) and -isMemberOfClass: (strict test).

--Kyle Sluder

_______________________________________________

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: NSStringFromClass versus className ?
      • From: "Kyle Sluder" <email@hidden>
References: 
 >NSStringFromClass versus className ? (From: Dave Jewell <email@hidden>)
 >Re: NSStringFromClass versus className ? (From: glenn andreas <email@hidden>)
 >Re: NSStringFromClass versus className ? (From: Dave Jewell <email@hidden>)
 >Re: NSStringFromClass versus className ? (From: Mike Abdullah <email@hidden>)
 >Re: NSStringFromClass versus className ? (From: "Kyle Sluder" <email@hidden>)

  • Prev by Date: NSComboBoxCell will not select
  • Next by Date: Re: Help with PDFPage to NSImage
  • Previous by thread: Re: NSStringFromClass versus className ?
  • Next by thread: Re: NSStringFromClass versus className ?
  • Index(es):
    • Date
    • Thread