Re: NSData to long
Re: NSData to long
- Subject: Re: NSData to long
- From: Nathan Day <email@hidden>
- Date: Tue, 8 Apr 2003 18:58:28 +0930
Use the method bytes to get a pointer to the data and just cast it. Or
you could use the method getBytes.
long int theLong;
[theData getBytes:(void*)&theLongInt length:sizeof(long int)];
On Tuesday, April 8, 2003, at 11:20 AM, David Blanton wrote:
NSAppleEventDescriptor * aDescriptor = [theDescriptor
descriptorAtIndex:i];
theData = [aDescriptor data];
NSLog(@"theData %@",theData); yields : theData <00000024 >
I want to convert the NSData object <00000024> to an NSString that
would be
"36"
NSString * str = [[NSNumber numberWithLong:foo] stringValue];
Would work if I could make <00000024> into a long. So how does one
get a
long value from an NSData object?
Still puzzled.
_______________________________________________
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.
Nathan Day
http://homepage.mac.com/nathan_day/
_______________________________________________
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.