[TxMt Plugins] Plugin requiremenets

Allan Odgaard throw-away-1 at macromates.com
Sat Feb 11 01:03:58 UTC 2006


On 11/2/2006, at 1:30, Gerd Knops wrote:

> I am experimenting with another plugin, but TM does not want to  
> load it:
> 	"instance TmShortcutSnitch plugin doesn't have proper initializer"

This error might also be because the bundle has no principal class.  
Here's the code I use to instantiate the plug-in:

    [plugInBundle load];
    id obj = [[plugInBundle principalClass] alloc];
    if([obj respondsToSelector:@selector(initWithPlugInController:)])
          instance = [obj initWithPlugInController: 
[TMPlugInController sharedInstance]];
    else  NSLog(@"%s %@ plugin doesn't have proper initializer",  
_cmd, [self name]);

Here `plugInBundle` is an NSBundle instance.




More information about the textmate-plugins mailing list