Re: NSStringFromClass versus className ?
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