Re: How can a plug-in bundle get access to its own resources?

2009-11-17 Thread Alastair Houghton
On 17 Nov 2009, at 08:59, Motti Shneor wrote: First, to clear things, I'm not WRITING plug-ins. I'm transitioning our EXISTING product line from Carbon to Cocoa, to be able to run within 64bit Host applications (which, do not exist yet.). Within this scope, I contemplate the way to

Re: How can a plug-in bundle get access to its own resources?

2009-11-16 Thread Steve Christensen
I understand your frustration, but as I said, one class instance per process is a feature of the Objective-C runtime and has been the case since before there was an OS X. Please understand that having 200 plug- ins, all using the same class name, is not a typical situation. You are doing it

Re: How can a plug-in bundle get access to its own resources?

2009-11-16 Thread Alastair Houghton
On Nov 15, 2009, at 11:35 PM, Motti Shneor wrote: Thank you all, and thank you Steve - I think the point is clear now. However, I'm afraid this limit renders the whole Obj-C interface for plug-ins impractical for any medium-to-large company with legacy code. Not really, no. There is

Re: How can a plug-in bundle get access to its own resources?

2009-11-15 Thread Motti Shneor
Thanks, but the bundleWithIdentifier has its own problems. 1. The identifier is (as far as i know) accessible only from the bundle itself, which I don't have! I'm circling around here, without access to my own resources! Must I hard-code the bundle identifier as a string constant within each

Re: How can a plug-in bundle get access to its own resources?

2009-11-15 Thread Mike Abdullah
On 15 Nov 2009, at 11:36 AM, Motti Shneor mot...@waves.com wrote: Thanks, but the bundleWithIdentifier has its own problems. 1. The identifier is (as far as i know) accessible only from the bundle itself, which I don't have! I'm circling around here, without access to my own resources!

Re: How can a plug-in bundle get access to its own resources?

2009-11-15 Thread Steve Christensen
As has been pointed out several times, it's a really bad idea to have the same-named class in multiple plugins. The Objective-C runtime will load the first class instance it finds (in your case, in the first- loaded plugin). For all other plugins, when the class is referenced, that first

How can a plug-in bundle get access to its own resources?

2009-11-10 Thread Motti Shneor
Hi. This may seem a silly question, but I cannot find any decent way for my Plug-In bundle code to access its own resources! The host application that loads my plug-in bundle does not pass me any NSBundle* or CFBundleRef, and I am wondering is there a complement to the [NSBundle mainBundle]

Re: How can a plug-in bundle get access to its own resources?

2009-11-10 Thread Benjamin Miller
On 10 Nov 2009, at 11:45, Motti Shneor wrote: This may seem a silly question, but I cannot find any decent way for my Plug-In bundle code to access its own resources! ... snip ... Is there a way out? Is there any trick, or technique to work around this bizarre deficiency of the Bundle

Re: How can a plug-in bundle get access to its own resources?

2009-11-10 Thread Benjamin Miller
On 10 Nov 2009, at 11:45, Motti Shneor wrote: Is there a way out? Is there any trick, or technique to work around this bizarre deficiency of the Bundle mechanism? That should have been: [NSBundle bundleForClass:[self class]] Benjamin ___

Re: How can a plug-in bundle get access to its own resources?

2009-11-10 Thread Kiel Gillard
On 10/11/2009, at 10:51 PM, Benjamin Miller wrote: On 10 Nov 2009, at 11:45, Motti Shneor wrote: This may seem a silly question, but I cannot find any decent way for my Plug-In bundle code to access its own resources! ... snip ... Is there a way out? Is there any trick, or technique to

Re: How can a plug-in bundle get access to its own resources?

2009-11-10 Thread Motti Shneor
Thanks guys, but you may have not read all my message --- The [NSBundle bundleForClass:[self class]]; is unusable for me, because I have many plugins that build from the same code, and export the same class (of course --- the same class name). Obj-C has no name-spaces, and so, If you load 2

Re: How can a plug-in bundle get access to its own resources?

2009-11-10 Thread Mike Abdullah
On 10 Nov 2009, at 12:59, Motti Shneor wrote: Thanks guys, but you may have not read all my message --- The [NSBundle bundleForClass:[self class]]; is unusable for me, because I have many plugins that build from the same code, and export the same class (of course --- the same class

Re: How can a plug-in bundle get access to its own resources?

2009-11-10 Thread Alastair Houghton
On 10 Nov 2009, at 12:59, Motti Shneor wrote: is unusable for me, because I have many plugins that build from the same code, and export the same class (of course --- the same class name). That's your mistake. You shouldn't do that. Class names must be unique within a process, otherwise you

Re: How can a plug-in bundle get access to its own resources?

2009-11-10 Thread Douglas Davidson
On Nov 10, 2009, at 4:59 AM, Motti Shneor wrote: Thanks guys, but you may have not read all my message --- The [NSBundle bundleForClass:[self class]]; is unusable for me, because I have many plugins that build from the same code, and export the same class (of course --- the same class

Re: How can a plug-in bundle get access to its own resources?

2009-11-10 Thread Michael Ash
On Tue, Nov 10, 2009 at 6:57 AM, Kiel Gillard kiel.gill...@gmail.com wrote: On 10/11/2009, at 10:51 PM, Benjamin Miller wrote: On 10 Nov 2009, at 11:45, Motti Shneor wrote: This may seem a silly question, but I cannot find any decent way for my Plug-In bundle code to access its own