Re: Instance Variable access
Re: Instance Variable access
- Subject: Re: Instance Variable access
- From: mmalcolm crawford <email@hidden>
- Date: Fri, 7 May 2004 21:09:04 -0700
On May 7, 2004, at 6:20 PM, mmalcolm crawford wrote:
I thought that had been addressed by Glen's answer -- using IMPs, see:
I may have misunderstood Tim's question:
If they're declared public, you can access an Objective-C object's
instance variables directly -- it's just a struct:
anObject->anIvar
To access instance variables directly there are also:
Ivar object_setInstanceVariable(id object, const char *name, void
*value);
<
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/
9objc_runtime_reference/chapter_5_section_49.html#//apple_ref/doc/uid/
20001426/object_setInstanceVariable>
and
Ivar object_getInstanceVariable(id object, const char *name, void
**value);
<
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/
9objc_runtime_reference/chapter_5_section_50.html#//apple_ref/doc/uid/
20001426/object_getInstanceVariable>
Again, typically bad ideas for reasons listed in the first reply.
mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.