> On Nov 18, 2015, at 7:24 AM, Eric Gorr <mail...@ericgorr.net > <mailto:mail...@ericgorr.net>> wrote: > > Yes, that all makes sense. So, the question is what can I do about it? The > number of tooltips I need is the same number of elements in the array and the > number of elements in the array can change over the lifetime of the > application. So, it is natural to store the information needed by the tooltip > inside of an array and pass a pointer to an array element as the userdata for > the tooltip. If my current implementation is not going to work, what is the > recommended implementation for this kind of behavior?
How about creating a context object or struct, with a single property to which you assign a copy of the array (or, alternatively, a computed property that dynamically returns the contents of the array)? Then you’re not making an UnsafePointer of the array itself, and it probably shouldn’t get unnecessarily assigned to. Charles _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com