• 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: NSNumber pointerValue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSNumber pointerValue
      • From: Björn Carlström <email@hidden>
References: 
 >Re: NSNumber pointerValue (From: Wade Tregaskis <email@hidden>)
 >Re: NSNumber pointerValue (From: Björn Carlström <email@hidden>)
 >Re: NSNumber pointerValue (From: Glenn Andreas <email@hidden>)
 >Re: NSNumber pointerValue (From: Björn Carlström <email@hidden>)
 >Re: NSNumber pointerValue (From: Alastair Houghton <email@hidden>)
 >Re: NSNumber pointerValue (From: Björn Carlström <email@hidden>)

  • Prev by Date: Public Headers in Xcode Framework
  • Next by Date: Re: cocoa-dev digest, Vol 2 #3237 - 13 msgs
  • Previous by thread: Re: NSNumber pointerValue
  • Next by thread: Re: NSNumber pointerValue
  • Index(es):
    • Date
    • Thread