• 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: Sensible way to extend base class?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sensible way to extend base class?


  • Subject: Re: Sensible way to extend base class?
  • From: Michael Ash <email@hidden>
  • Date: Wed, 20 May 2009 12:27:56 -0400

On Wed, May 20, 2009 at 11:21 AM, Keith Duncan <email@hidden> wrote:
>
>> One would think that given the Objective-C 2.0 runtime (which is only
>> available on iPhone OS, or 64-bit mode in Mac OS, ARGH!) and its support for
>> iVar layouts, adding an ivar to an existing class would be possible. Since
>> it isn't [...]
>
> I thought that was one of the features of the Objective-C 2.0 runtime, is a
> non-fragile base class. Enabled by runtime computed instance variable
> offsets - which is why direct instance variable access is highly discouraged
> in any Objective-C 2.0 code.

Yes, it allows you to change the size of a class at load time. It does
not, however, allow you to change the size of a class at runtime,
because any existing instances won't get updated to reflect the new
size. you may be able to hack it up with Gwynne's code, but if so you
must be absolutely sure that you do that before any instances get
created.

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: 
 >Sensible way to extend base class? (From: Graham Cox <email@hidden>)
 >Re: Sensible way to extend base class? (From: Jerry Krinock <email@hidden>)
 >Re: Sensible way to extend base class? (From: Graham Cox <email@hidden>)
 >Re: Sensible way to extend base class? (From: Jonathan del Strother <email@hidden>)
 >Re: Sensible way to extend base class? (From: Gwynne Raskind <email@hidden>)
 >Re: Sensible way to extend base class? (From: Keith Duncan <email@hidden>)

  • Prev by Date: Re: Bindings and KVO of View objects
  • Next by Date: Re: Sensible way to extend base class?
  • Previous by thread: Re: Sensible way to extend base class?
  • Next by thread: Re: Sensible way to extend base class?
  • Index(es):
    • Date
    • Thread