Re: NSNumber pointerValue
Re: NSNumber pointerValue
- Subject: Re: NSNumber pointerValue
- From: Alastair Houghton <email@hidden>
- Date: Wed, 19 Nov 2003 20:54:29 +0000
On 19 Nov 2003, at 19:45, Bjvrn Carlstrvm wrote:
>
I'm dragging internal objects that are represented by a sting in a
>
list into another view. I want to create a link from the destination
>
to the object being dragged. My data structure requires this to be a
>
pointer. I looked at alternatives, draggimg the string and then after
>
the drag looking up the original object in a table, etc. But all the
>
alternatives has drawbacks and seem akward and slow.
Why not give the strings some sort of unique identifier, and use that
instead? It's much better than placing pointers on a pasteboard, not
only because it will work, but also because it's more robust. If you
use an NSMutableDictionary (or some other hash-table-based mechanism)
to hold a mapping between unique ID and string, it will be more than
fast enough; more to the point, you will be able to tell whether or not
the value you get back from the pasteboard is valid, something which
you cannot do if you put a pointer on there.
Kind regards,
Alastair.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.