NSNumber pointerValue
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.