Re: NSNumber pointerValue
Re: NSNumber pointerValue
- Subject: Re: NSNumber pointerValue
- From: Björn Carlström <email@hidden>
- Date: Wed, 19 Nov 2003 20:45:17 +0100
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.
Dragging pointers has been discussed on this messageboard before and I
believe it got the solution to convert the pointer to a NSNumber from
someone on this board. It's an elegant solution to my problem. I'm only
confused buy the behaviour of NSNumber. I think no object should return
different results before and after being placed on the pasteboard.
I hope this answers your question.
All the best
Bjvrn
2003-11-19 kl. 19.41 skrev Alastair Houghton:
On 19 Nov 2003, at 18:00, Bjvrn Carlstrvm wrote:
I cannot agree that it seems reasonable for the value to become nil.
NSValue and NSNumber takes a value in a variety of forms and then
performs converions to different types. To refuse to make a certain
conversion after being archived seems like a safety feature. Sure the
pointer could be invalid, but believe me, in my case passing nil is
more invalid. I also don't believe the pasteboard is designed with a
preferenece to local or non local passing of data.
Nobody seems to have asked you why on Earth you are putting a pointer
on a pasteboard in the first place... so, why do so? It isn't what
pasteboards were intended for; surely there is a better alternative?
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.
_______________________________________________
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.