Re: class method list
Re: class method list
- Subject: Re: class method list
- From: Chris Hanson <email@hidden>
- Date: Fri, 1 Nov 2002 19:06:22 -0600
At 3:36 PM -0800 11/1/02, Eric Cole wrote:
Given an arbitrary object (Object *it), how is the class object of
that object retrieved. Say that the object was an NSView, how would
you get [NSView class] from the object? can you say [[it class]
class];?
This is in the documentation for the NSObject protocol (instance
methods) and NSObject class (class methods).
Sending -class to an object gets its Class.
Sending +class to a class gets its Class.
So to get the Class of an arbitrary object -- say "id it" (not Object
*it as you wrote above) -- you just use [it class].
-- Chris
--
Chris Hanson | Email: email@hidden
bDistributed.com, Inc. | Phone: +1-847-372-3955
Making Business Distributed | Fax: +1-847-589-3738
http://bdistributed.com/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.