> On Nov 18, 2015, at 10:17 AM, Quincey Morris 
> <[email protected]> wrote:
> 
> If the array element (a dictionary, in your original post) is small enough, 
> you can pass a pointer to a copy of the element instead of a pointer to the 
> element. That is:
> 
>       var myElement = myArray[0]
>       view.addToolTipRect( NSMakeRect( 0, 0, 100, 100), owner: self, 
> userData: &myElement )

Doesn’t the pointer become invalid as soon as myElement goes out of scope? 
(There’s a reason that type is called *Unsafe*Pointer…)

—Jens
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to