RE: NSBundle dynamic loading problem
RE: NSBundle dynamic loading problem
- Subject: RE: NSBundle dynamic loading problem
- From: "Josh Ferguson" <email@hidden>
- Date: Mon, 19 Dec 2005 15:03:07 -0600
- Thread-topic: NSBundle dynamic loading problem
Uli,
Thanks for the recommendation, but unfortunately this isn't a
possibility. I'm actually writing a framework that will be used by other
developers.
I know that the OS isn't returning a cached pointer for the Bundle, as I
get the appropriate version from the bundle. I've also tried making sure
it's always moved to a unique temp directory and even gone as far as
making sure that the framework is renamed to a unique name...none of
this helps. The Bundle is pointing at the proper location and getting
the proper data from the info.plist, but a call to -load doesn't seem to
be loading the executable data. I know for absolutely sure the bundle
has never been loaded from that location. There's something else that
the OS is caching to identify that bundle and I can't figure out what it
is.
Josh
-----Original Message-----
From: Uli Kusterer [
mailto:email@hidden]
Sent: Monday, December 19, 2005 2:43 PM
To: Josh Ferguson
Cc: email@hidden
Subject: Re: NSBundle dynamic loading problem
Am 19.12.2005 um 19:13 schrieb Josh Ferguson:
>
I've been beating my head over this for days...if anyone has any
>
insight
>
it would be greatly appreciated.
Looks like the OS notices it already loaded a framework from that
path and just returns you a pointer to the previous (cached) copy,
thinking you were trying to load the same framework a second time.
NSBundle is known not to load a bundle twice when it can re-use an
existing instance.
Since Cocoa doesn't support unloading classes yet, it seems like a
wasteful and complicated approach to reload a framework this way.
You'd have to rename *all* classes for each version to make sure you
get the new ones.
I'd personally chicken out and just write a little helper tool. Then
you could quit the old version of the application after launching the
helper, and the helper would re-launch the new version (and thus
loads the new framework).
A nice side effect of this would be that you'd have to add
persistence code to your app so it can load all windows and documents
again after the re-launch, so the user doesn't have to re-open, re-
scroll etc. everything.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
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