• 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: Pointer to static object member
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pointer to static object member


  • Subject: Re: Pointer to static object member
  • From: Marcel Weiher <email@hidden>
  • Date: Thu, 26 Sep 2002 10:00:26 +0200

On Thursday, September 26, 2002, at 03:37 Uhr, John Scalo wrote:

Is it possible to get a pointer to a static object member?

What's a static object member? Do you mean an instance variable?

Anyway, yes it is possible to get pointers to instance variables, but you don't want to do this.

i.e. the equivalent of "&[myFileObj fsRef]".

No, that won't work, because you can't take the pointer of an expression:

&(3+4)

doesn't work.

I'm thinking this must border on obvious, but haven't found it documented anywhere.

It isn't documented anywhere, because you're not supposed to do it. You are supposed to use methods to access an object's data.

If you have API that requires a pointer to the value, put it in a temp and pass a pointer to that.

Marcel

--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
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.

  • Follow-Ups:
    • Re: Pointer to static object member
      • From: Chris Ridd <email@hidden>
References: 
 >Pointer to static object member (From: John Scalo <email@hidden>)

  • Prev by Date: Switcher ( was Re: Book-OT )
  • Next by Date: Re: NSUndoManager & NSTableView editing
  • Previous by thread: Pointer to static object member
  • Next by thread: Re: Pointer to static object member
  • Index(es):
    • Date
    • Thread