[TxMt Plugins] sendAction Question

Rob Rix rix.rob at gmail.com
Sat Mar 17 21:58:38 UTC 2007


Yes, you are doing something wrong.

I don't know if -sendAction:to:from: is the best way to accomplish  
your goal here, but you definitely don't want to be doing  
sel_registerName here. Instead you want @selector as follows:

[[NSApplication sharedApplication] sendAction: @selector(moveLeft:)  
to: nil from: self];

Notice the colon after moveLeft. Action methods always take a  
'sender' argument, which is what you're supplying in the 'from:' part  
of sendAction:to:from:. See file:///Developer/ADC%20Reference% 
20Library/documentation/Cocoa/Reference/ApplicationKit/Classes/ 
NSresponder_Class/index.html for more information.

Rob

On 17-Mar-07, at 5:52 PM, Kirt Fitzpatrick wrote:

> I am trying to call the moveLeft method on the editor window and I  
> don't seem to be having any luck.  I am a bit of a n00b to  
> Objective C so I assume that I must be missing something.  This is  
> what I came up with.  Am I doing something wrong?
>
> SEL methodSelector = sel_registerName( "moveLeft" );
> [[NSApplication sharedApplication] sendAction:methodSelector to:nil  
> from:self];
>
> kirt
>
> _______________________________________________
> textmate-plugins mailing list
> textmate-plugins at lists.macromates.com
> http://lists.macromates.com/mailman/listinfo/textmate-plugins




More information about the textmate-plugins mailing list