Re: Detecting a native Cocoa app ?
Re: Detecting a native Cocoa app ?
- Subject: Re: Detecting a native Cocoa app ?
- From: Uli Kusterer <email@hidden>
- Date: Thu, 07 Feb 2013 12:59:59 +0100
There is no such thing as that. Any application can mix Carbon and Cocoa calls, and Carbon applications these days have been forced to use certain Cocoa APIs (e.g. NSOpenPanel, NSAlert, NSCursor etc.) to work around bugs/deprecations in API. It's not a good idea to try to detect what kind of application you're dealing with in a general way.
I've seen input managers that assumed an application with an NSPrincipalClass key was Cocoa and stuff like that, but that's simply not true. Find out why your plugin crashes, and try to find a way to detect that *particular* circumstance beforehand and avoid doing the crashing action in that case.
Simplistic notions like that are exactly why input managers/haxies have such a bad reputation among application developers (and users, even, these days).
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
On Feb 7, 2013, at 9:32 AM, email@hidden wrote:
> I have developped a SIMBL plugin that does some hacking on the GUI of
> the target application (menus and stuff). However, it works well only on
> native Cocoa applications (it may crash others).
>
> I would like to automatically detect when the target application is
> native cocoa, so that I may switch the plugin off otherwise. How would
> you do that ?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden