• 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_respondsToSelector() in runtime.h?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: class_respondsToSelector() in runtime.h?


  • Subject: Re: class_respondsToSelector() in runtime.h?
  • From: Michael Ash <email@hidden>
  • Date: Thu, 1 Jul 2010 13:37:49 -0400

On Thu, Jul 1, 2010 at 1:30 PM, Jonathon Kuo
<email@hidden> wrote:
>
> On Jul 1, 2010, at 9:49 AM, Kyle Sluder wrote:
>
>> On Jul 1, 2010, at 9:42 AM, Jonathon Kuo <email@hidden> wrote:
>>
>>> On Jul 1, 2010, at 7:56 AM, Matt Neuburg wrote:
>>>
>>>> "Instance methods defined in a root class can be performed both by instances
>>>> and by class objects. Therefore, all class objects have access to the
>>>> instance methods defined in the root class."
>>>
>>> Not that it would generally be USEFUL to do so, since the purpose of an instance is to hold instance variable values; a class object accessing instance variables through an instance method would come up with uninitialized ivar values, no?
>>
>> They are instances of the root class, so they have all the root class instances variables, of which there is precisely one: isa.
>
> Interesting... so what happens at runtime if a class object invokes an instance method that accesses instance variables? Exception? Assertion? Seg fault?

I think you may have missed the part where only instance methods
defined IN A ROOT CLASS can be performed by class objects. Therefore
the scenario that you describe cannot occur.

Mike
_______________________________________________

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

References: 
 >Re: class_respondsToSelector() in runtime.h? (From: Matt Neuburg <email@hidden>)
 >Re: class_respondsToSelector() in runtime.h? (From: Jonathon Kuo <email@hidden>)
 >Re: class_respondsToSelector() in runtime.h? (From: Kyle Sluder <email@hidden>)
 >Re: class_respondsToSelector() in runtime.h? (From: Jonathon Kuo <email@hidden>)

  • Prev by Date: Re: class_respondsToSelector() in runtime.h?
  • Next by Date: Re: Finder-like conversion of a fileURL to 'user-friendly' path
  • Previous by thread: Re: class_respondsToSelector() in runtime.h?
  • Next by thread: Re: class_respondsToSelector() in runtime.h?
  • Index(es):
    • Date
    • Thread