Re: Accessing @private superclass ivars
Re: Accessing @private superclass ivars
- Subject: Re: Accessing @private superclass ivars
- From: James Bucanek <email@hidden>
- Date: Mon, 19 Feb 2007 16:18:57 -0700
Keith Duncan wrote on Monday, February 19, 2007:
>I'm subclassing a class which has a private NSArray ivar containing
>some objects I need access to in my subclass.
Cheat!
Objective-C's @defs(class_name) directive will be replaced with the structure of any ObjC class as a struct statement. Create a typedef using the @defs() directive, then cast your object pointer to that type. You now have direct access all ivars; scope restrictions are thrown out the window.
For obvious reasons, this isn't something you want to do on a regular basis.
--
James Bucanek
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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