• 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: Key-Value Coding Limitations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Key-Value Coding Limitations
      • From: Graham J Lee <email@hidden>
References: 
 >Re: Key-Value Coding Limitations (From: James Bucanek <email@hidden>)
 >Re: Key-Value Coding Limitations (From: Mike Abdullah <email@hidden>)
 >Re: Key-Value Coding Limitations (From: Jonathon Mah <email@hidden>)
 >Re: Key-Value Coding Limitations (From: Graham J Lee <email@hidden>)

  • Prev by Date: Re: Undefined symbols error in deployment build
  • Next by Date: Displaying Core Data using Cocoa binding programmatically
  • Previous by thread: Re: Key-Value Coding Limitations
  • Next by thread: Re: Key-Value Coding Limitations
  • Index(es):
    • Date
    • Thread