Re: Sensible way to extend base class?
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