NSAppleEventDescriptor & Extracting a Date value
NSAppleEventDescriptor & Extracting a Date value
- Subject: NSAppleEventDescriptor & Extracting a Date value
- From: Steve Cronin <email@hidden>
- Date: Fri, 4 Jan 2008 20:09:04 -0600
Folks;
I need to pull a date out of an NSAppleEventDescriptor.
The code below is working for all of the other types.
How do I get the date value?
I've tried everything I can think of and all google-found code no
longer compiles.
This is Tiger/XCode 2.4.1.
I know about Leopard and the 'bridge'; that is not an option here.
Thanks!
Steve
-(id) getValueFromDescriptor:(NSAppleEventDescriptor *)descriptor {
NSDate *resultDate;
switch ([descriptor descriptorType]) {
case typeChar:
case typeUnicodeText:
return [descriptor stringValue];
case typeBoolean:
return [NSNumber numberWithBool:(BOOL)[descriptor booleanValue]];
case typeTrue:
return [NSNumber numberWithBool:YES];
case typeFalse:
return [NSNumber numberWithBool:NO];
case typeNull:
return [NSNull null];
case typeSInt16:
return [NSNumber numberWithInt:(short)[descriptor int32Value]];
case typeSInt32:
return [NSNumber numberWithInt:(int)[descriptor int32Value]];
case typeUInt32:
return [NSNumber numberWithLong:(unsigned int)[descriptor
int32Value]];
case typeLongDateTime:
//this case gets exercised appropriately - I just can't extract
the value
return resultDate;
}
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden