• 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
Re: find what type of object a variable belongs to
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Handling Delete Key Events in NSOutlineView
  • Next by Date: Re: CoreData question
  • Previous by thread: Re: find what type of object a variable belongs to
  • Next by thread: NSPersistentDocument - where is setManagedObjectModel
  • Index(es):
    • Date
    • Thread