• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSBundle dynamic loading problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBundle dynamic loading problem


  • Subject: Re: NSBundle dynamic loading problem
  • From: Uli Kusterer <email@hidden>
  • Date: Mon, 19 Dec 2005 21:42:37 +0100

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
References: 
 >NSBundle dynamic loading problem (From: "Josh Ferguson" <email@hidden>)

  • Prev by Date: Using the QuickLite framework when building a Foundation tool
  • Next by Date: Saving an image to disk
  • Previous by thread: NSBundle dynamic loading problem
  • Next by thread: Re: NSBundle dynamic loading problem
  • Index(es):
    • Date
    • Thread