• 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: Passing numbers through userdata
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing numbers through userdata


  • Subject: Re: Passing numbers through userdata
  • From: Larry Fransson <email@hidden>
  • Date: Wed, 15 Dec 2004 07:31:56 -0800


On Dec 15, 2004, at 06:54, Fritz Anderson wrote:

If I pass an int directly through the userdata property, I get the problem "warning: passing arg 3 of `addTrackingRect:owner:userData:assumeInside:' makes pointer from integer without a cast" However, it does work, even though when I retrieve the int I get the warning, "assignment makes integer from pointer without a cast"

You could cast the integer to void * (as in userData: (void *) myInt), but it is bad karma to use pointer storage for integers (and vice versa, as when you do the reverse cast at the other end).

Why not pass &myInt? Wouldn't that work?

Larry Fransson
Seattle, WA

_______________________________________________
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: Passing numbers through userdata
      • From: Clark Cox <email@hidden>
References: 
 >Passing numbers through userdata (From: Christopher Drum <email@hidden>)
 >Re: Passing numbers through userdata (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: NSBrowser problems
  • Next by Date: Export to a Movie
  • Previous by thread: Re: Passing numbers through userdata
  • Next by thread: Re: Passing numbers through userdata
  • Index(es):
    • Date
    • Thread