• 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: Graham J Lee <email@hidden>
  • Date: Fri, 12 May 2006 12:18:52 +0100

On 12 May 2006, at 11:47, Jonathon Mah wrote:

On 2006-05-12, at 20:08, Graham J Lee wrote:

this could be a job for @defs:


that is, AFAICR, the first and only time I have ever written that.

#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.

Thinking and typing without testing: can you add accessors via a category? I think that whatever you do though, you're still going to end up with code which depends on the in-memory layout of the object (i.e. needs a recompile every time the upstream people change their code).


--
Graham J Lee
"Oxford University's UNIX Expert"
As seen in MacWorld UK
http://iamleeg.blogspot.com


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

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>)
 >Re: Key-Value Coding Limitations (From: Jonathon Mah <email@hidden>)

  • Prev by Date: Ipod integration
  • Next by Date: Re: NSDrawer in System Pref Pane
  • Previous by thread: Re: Key-Value Coding Limitations
  • Next by thread: How to control the commit of text edit field with binding?
  • Index(es):
    • Date
    • Thread