On Oct 8, 2010, at 16:42:18, Kyle Sluder wrote:

> On Fri, Oct 8, 2010 at 4:39 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> I'm trying to add an ivar to a (sub)class in the base class' +initialize 
>> method. I'm not sure if it's too late to do it at this point or not. If I 
>> can't do it here, i don't know where to make the call.
> 
> From the documentation:
> 
> "Adding an instance variable to an existing class is not supported."
> 
> http://developer.apple.com/library/ios/#documentation/cocoa/reference/ObjCRuntimeRef/Reference/reference.html

Yes, I read that. I had hoped that I'd be able to add ivars before the class 
was instantiated. In this case, the class is being loaded dynamically at run 
time. Is there no way to get in the middle of the load and add an ivar?

In any case, sure seems like I ought to be able to do it in +initialize.

I'll try objc_setAssociatedObject(). Thanks.

-- 
Rick

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to