Re: find what type of object a variable belongs to
Re: find what type of object a variable belongs to
- Subject: Re: find what type of object a variable belongs to
- From: Matt Neuburg <email@hidden>
- Date: Sun, 25 Sep 2005 11:04:36 -0700
- Thread-topic: find what type of object a variable belongs to
On Sun, 25 Sep 2005 09:56:56 +1000, Aaron Wallis <email@hidden>
said:
>Hi there,
>
>im starting to play around with applescript in cocoa, and i've got
>this strange problem where strings being returned by a applescript
>aren't necesarrily assocuated with a particular class/object, so Im
>finding it ery hard to work with the data once returned.
>
>I was wondering if there was any way of tracking down what the data
>type is during runtime?
>for example:
>
> int myInt = 7;
> NSString * myString = @"hello world.";
>
> NSLog(@"%@", [ myString isType ]) // logs NSString
> NSLog(@"%@", [ myInt isType ]) // logs int
That example looks artificial. What are you *really* trying to do? Are you
calling executeAndReturnError? If so, the result is an
NSAppleEventDescriptor and you must use its methods to parse it and get the
data out. My book gives an example, or if you would show some action code I
can give you a more specific example showing how you would deal with
whatever you're receiving. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden