Re: Key-Value Coding Limitations
Re: Key-Value Coding Limitations
- Subject: Re: Key-Value Coding Limitations
- From: Jonathon Mah <email@hidden>
- Date: Fri, 12 May 2006 20:17:55 +0930
On 2006-05-12, at 20:08, Graham J Lee wrote:
It breaks encapsulation (i.e. it *does* count as directly accessing
the ivars), but this could be a job for @defs:
#import <Foundation/Foundation.h>
@interface GLWibble:NSObject
{
int x;
double y;
}
@end
@implementation GLWibble [...] @end
typedef struct { @defs(GLWibble) } *CGLWibbleRef;
int main (int argc, const char * argv[]) {
GLWibble *myWibble=[GLWibble new];
CGLWibbleRef coreWibble=(CGLWibbleRef) myWibble;
printf("x:\t%d\ny:\t%g\n\n",coreWibble->x,coreWibble->y);
return 0;
}
This still has the problem I'm trying to avoid; I want to access
ivars by name so that the plugin will still work when the ivar layout
of the host app changes. I hadn't heard about @defs() though --
thanks for bringing it to my attention.
Jonathon Mah
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden