Re: NSStringFromClass versus className ?
Re: NSStringFromClass versus className ?
- Subject: Re: NSStringFromClass versus className ?
- From: "Kyle Sluder" <email@hidden>
- Date: Thu, 28 Feb 2008 02:46:55 -0500
On Wed, Feb 27, 2008 at 7:17 AM, Mike Abdullah
<email@hidden> wrote:
> 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?
The comment wasn't really directed at you, it was kind of an
augmentation of your point. Object comparisons are more common than
logging operations; one might assume upon seeing NSStringFromClass()
that they could perform a string comparison to determine if an object
is of their desired class, and this doesn't work for subclasses and
will lead to head-scratching if the object is being KVO observed and
has thus been isa-swizzled.
--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