NSStringFromClass versus className ?
NSStringFromClass versus className ?
- Subject: NSStringFromClass versus className ?
- From: Dave Jewell <email@hidden>
- Date: Wed, 20 Feb 2008 15:15:55 +0000
I've seen lots of Cocoa code which uses NSStringFromClass to obtain
the name of a particular class, but relatively little code which uses
NSObject's built-in className method. Is there a particular reason
for this? Is there some hidden 'gotcha inside className waiting to
bite me?
I've seen lots of code that looks (e.g.) this:
NSLog (NSStringFromClass ([self class]));
From where I'm sitting, this could be replaced with:
NSLog ([self className]);
Not only is this neater, but it's more "the Cocoa way", in terms of
not calling a procedure.
Dave
_______________________________________________
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