From gerti-textmate at bitart.com Sat Feb 11 00:30:53 2006 From: gerti-textmate at bitart.com (Gerd Knops) Date: Fri, 10 Feb 2006 18:30:53 -0600 Subject: [TxMt Plugins] Plugin requiremenets Message-ID: <8659B7A7-7BEF-4057-868F-1BE85C333EC7@bitart.com> Hello Allan, I am experimenting with another plugin, but TM does not want to load it: "instance TmShortcutSnitch plugin doesn't have proper initializer" TmShortcutSnitch does have - (id)initWithPlugInController:(id)aController; - (void)deregister; - (void)dealloc; What am I missing? Gerd From throw-away-1 at macromates.com Sat Feb 11 01:03:58 2006 From: throw-away-1 at macromates.com (Allan Odgaard) Date: Sat, 11 Feb 2006 02:03:58 +0100 Subject: [TxMt Plugins] Plugin requiremenets In-Reply-To: <8659B7A7-7BEF-4057-868F-1BE85C333EC7@bitart.com> References: <8659B7A7-7BEF-4057-868F-1BE85C333EC7@bitart.com> Message-ID: 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. From gerti-textmate at bitart.com Sat Feb 11 20:29:13 2006 From: gerti-textmate at bitart.com (Gerd Knops) Date: Sat, 11 Feb 2006 14:29:13 -0600 Subject: [TxMt Plugins] Plugin requiremenets In-Reply-To: References: <8659B7A7-7BEF-4057-868F-1BE85C333EC7@bitart.com> Message-ID: On Fri, Feb 10, at 7:03 PM, Allan Odgaard wrote: > 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. Yep, that's it. Even though the class is the first in XCode AND listed as NSPrincipalClass in Info.plist, the bundle returns 'NULL' as principal class. No idea why, it 'just worked' with TmCodeBrowser... The plugin is here: http://www.cocoabits.com/TmShortcutSnitch/ I am currently instantiating it during +load, which is sort of ugly... Gerd