• 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: Instance Variable access
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Re: Instance Variable access (From: mmalcolm crawford <email@hidden>)
 >Re: Instance Variable access (From: "Tim Ramsey" <email@hidden>)
 >Re: Instance Variable access (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Archiving ABPerson
  • Next by Date: Re: Empty Table
  • Previous by thread: Re: Instance Variable access
  • Next by thread: Re: Instance Variable access
  • Index(es):
    • Date
    • Thread