Re: KVC with an path, AppleScript and InterfaceBuilder
Re: KVC with an path, AppleScript and InterfaceBuilder
- Subject: Re: KVC with an path, AppleScript and InterfaceBuilder
- From: Dustin Voss <email@hidden>
- Date: Tue, 24 Jan 2006 22:17:50 -0800
On 24 Jan 2006, at 7:52 AM, Thomas Engelmeier wrote:
Is there any well known magic for the following two tasks:
- validation - happens usually automatically with min / max values
for Cocoa UI bindings?
- recordability for a KVC application - synthesize AppleEvents to
self to allow recording?
It may not be a well-known trick, but recording is certainly
possible. One of my partially-completed Cocoa apps supports
recording. I've published few category methods so that other can also
directly dispatch Apple Events easily.
Basically, you supply an Apple Event, a handler for the event
(typically a sub-class of NSScriptCommand), and an NSInvocation to
process the result.
My methods direct-dispatch the event to the app. The handler picks it
up and acts on it. If the handler needs to suspend execution for
network access or something, no problem, it just calls a resume
method I supply when it is ready to send the result.
With or without suspending, my methods invoke the NSInvocation with
the result or error. Also, the event can be sent with the don't-
execute flag, in which case you don't need a handler and the
NSInvocation is not invoked, though it is still recorded.
You can get the .zip file at http://homepage.mac.com/d.j.v./
FileSharing13.html.
_______________________________________________
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