• 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: class method list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >class method list (From: Eric Cole <email@hidden>)

  • Prev by Date: Bi-directional Text
  • Next by Date: Re: Indexing text, pdf, .doc
  • Previous by thread: class method list
  • Next by thread: Re: class method list
  • Index(es):
    • Date
    • Thread