[SOLVED] Mixing cocoa and carbon crashing in photoshop plugin
[SOLVED] Mixing cocoa and carbon crashing in photoshop plugin
- Subject: [SOLVED] Mixing cocoa and carbon crashing in photoshop plugin
- From: Scott Andrew <email@hidden>
- Date: Wed, 30 Nov 2005 07:17:46 -0800
I solved this. I think i might just have to write a quick and dirty
tutorial on developing photoshop plugins using cocoa and carbon. I
ended up having to create a cocoa bundle in the contents folder of
my carbon plugin and loading it manually. I then export 2 C functions
an InitCocoa and a RunPlugin and all is working well.
Scott
On Nov 29, 2005, at 12:34 PM, Scott Andrew wrote:
Can i get an answer to these questions?? It seems that Photoshop is
unloading the plugin when done with it. So would creating a Cocoa
bundle and putting the bulk of the plugin code in there be the
correct thing to do? What happends when my carbon bundle unloads
and then i load my cocoa bundle again?
On Nov 24, 2005, at 8:40 AM, Scott Andrew wrote:
I had one ore question. If the plugin is being unloaded (which i
think it is becuase the 2nd time around i can't hit my break
points in my code), how can i tell if i am already loaded if my
carbon bundle goes away? Do i store a pointer to the bundle in the
cocoa plugin? Or will OSX deal with that for me when i call
CFBundleLoadExecutable? I am guessing i would just write my Cocoa
bundle just like any normal with a few "C" calls for calling into
the bundle and an init call (like the docs) that calls
NSApplicationLoad.
ok one more question. how can i tell if the bundle is being unloaded?
On Nov 24, 2005, at 6:22 AM, Rosyna wrote:
Is photoshop unloading your plugin?
According to the documentation, "NSBundle correctly loads
Objective-C symbols into the runtime system, but there is no way
to unload Cocoa bundles once loaded due to a runtime limitation."
I actually do everything dynamically. Load the objective-c
runtime, then use objc_msgSend() to call all the things I need.
Or call something that I know will load cocoa for me like
FCCopyCollectionNames() (although I have no idea why this loads
Cocoa on 10,4, it shouldn't since the API it is using doesn't
require Cocoa for anything, but oh well).
Some others just have a cocoa bundle that they load from their
carbon bundle with no ill affects. I do that as well, however my
cocoa bundle only contains a category (too lazy to register a
category on a class dynamically).
Ack, at 11/24/05, Scott Andrew said:
I have a photoshop plug-in that i am mixing cocoa and carbon in
and i am getting intermittent crashes. I do call
NSApplicationLoad like i should. The 2nd time i come through the
app i don't hit my break points. Now i saw something about
bundles with coco never unloading so I am thinking this could be
the solution.
So my thought was to create a cocoa bundle that is loaded by my
Carbon bundle. I want to use cocoa for the UI. I was wondering
if checking CFBoundleIsLoaded would be a check i should make and
don't reload the plugin the 2nd time around if tis loaded. Has
anyone mixed carbon/cocoa in a plugin? Did you seperate the
cocoa into a seperate bundle or code?
--
Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug
Unsanity: Unsane Tools for Insanely Great People
It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40adelphia.net
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40adelphia.net
This email sent to email@hidden
_______________________________________________
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