IPAD must-haves. And fun-to-haves.

Brighten your iPad with a colorful cover, stream to your TV, download pictures from your digital camera, and more. There’s already so much you can do with iPad and iPad mini

Apple Wireless Keyboard

The incredibly thin Apple Wireless Keyboard uses Bluetooth technology, which makes it compatible with iPad

Apple unveils iPad mini: ‘Thin as a pencil, light as paper’

iPad inspires creativity and hands-on learning with features you won’t find in any other educational tool

Lightning connector and FaceTime HD camera

Apple announces 4th generation iPad packing an A6X CPU

Pages

Showing posts with label setLabelforSegment. Show all posts
Showing posts with label setLabelforSegment. Show all posts

Friday, August 9, 2013

Re: ApplescriptObjectiveC (ASOC): setLabel:forSegment:

1.  Call method was an AppleScript Studio command to call an arbitrary Cocoa method.  This is not needed in ASObjC since it calls the various Cocoa methods directly.

 

2. The regular (free) Objective-C/Cocoa documentation is apparently what Apple expects you to use.  There are a few ASObjC specific resources, for example MacScripter's AppleScriptObjC in Xcode tutorials, but the best documentation is still Shane Stanley's excellent AppleScriptObjC Explored ebook (not free).

 

3. One of the big differences with AppleScriptObjC (as you have found out) is the naming convention when using Cocoa methods.  Instead of the names and arguments being mixed, the equivalent ASObjC method uses a more or less standard AppleScript handler name with underscores as placeholders for the arguments, so your example NSSegmentedControl statement would be:

    logintextbutton's setLabel_forSegment_("Delete", 2)

 

See the AppleScriptObjC Release Notes for information about converting from Objective-C (there are also some conversion scripts out there that will convert methods from the documentation).


View the original article here

Thursday, August 8, 2013

ApplescriptObjectiveC (ASOC): setLabel:forSegment:

Hi there,

 

I use ApplescriptObjectiveC (ASOC) in my programs, but I'm extremely bad at giving cocoa objects orders.

I saw that there was a command "call method ...", and it looked extremely handy, but it doesn't work on Lion (which my Mac uses).

1: Is there an alternative to "call method ..."?

 

Besides that:

2: Does anybody know tutorials or sites that offer free knowledge for ASOC?

 

And my real question:

I have a NSSegmentedControl (button), and I want to use the

(void)setLabel:(NSString *)label forSegment:(NSInteger)segment command.

As I've understood, I should change such commands into

logintextbutton's setLabel_("Delete") forSegment_(2)

 

But this throws up the error "Expected end of line, ect. but found identifier."

3: Who can solve this mystery?

 

Really, really thanks

 

Isaiah

 

P.S. I will only reward with "solved questions" for the third question.

Nevertheless I will reward "helpful answer" to every helpful answer (:


View the original article here