• 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
NSAppleEventDescriptor & Extracting a Date value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Select MenuItem
  • Next by Date: Re: Circular initialization of controllers in NIB file
  • Previous by thread: Re: Select MenuItem
  • Next by thread: Re: NSAppleEventDescriptor & Extracting a Date value
  • Index(es):
    • Date
    • Thread