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

NSNumber pointerValue


  • Subject: NSNumber pointerValue
  • From: Björn Carlström <email@hidden>
  • Date: Mon, 17 Nov 2003 22:51:50 +0100

I'm using this code to put a pointer into a NSNumber

NSNumber* theNumber = [NSNumber numberWithInt:(int)res];
NSLog(@"Dragging resource %@",theNumber);
Resource* theRes;
theRes = [theNumber pointerValue];

The last two lines are just a check to see if I can get the pointer back, which I can.

However, putting theNumber on the pasteboard and retrieving it after a drag operation works differently. The NSNumber contains the correct value and I can type cast it to the desired pointer, but the line:
theRes = [theNumber pointerValue];
returns nil!

My workarround looks like this.
theRes = (Resource*) [theNumber intValue];

Does anybody know why this would yield different results before and after being on the pasteboard?
_______________________________________________
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: Ali Ozer <email@hidden>
    • Re: NSNumber pointerValue
      • From: Wade Tregaskis <email@hidden>
  • Prev by Date: Copyrights, Interfaces, etc. (attn: Apple Reps)
  • Next by Date: CVS plugin for the Finder?
  • Previous by thread: Re: Copyrights, Interfaces, etc. (attn: Apple Reps)
  • Next by thread: Re: NSNumber pointerValue
  • Index(es):
    • Date
    • Thread