How to re-read a bundle once read?

  • I can use [NSBundle bundleWithPath:<somePath>] to get a bundle
    object. Code resources from it get brought in with a "load" method,
    and with Leopard I can now "unload" them.

    Is there a way to "close" the bundle? The bundle varies over time,
    and what I'd like to do is read it, load it, unload it, then re-read
    it again.

    Thanks,

    David
  • On Jan 14, 2008 2:20 PM, David Hoerl <dhoerl...> wrote:
    > I can use [NSBundle bundleWithPath:<somePath>] to get a bundle
    > object. Code resources from it get brought in with a "load" method,
    > and with Leopard I can now "unload" them.
    >
    > Is there a way to "close" the bundle? The bundle varies over time,
    > and what I'd like to do is read it, load it, unload it, then re-read
    > it again.
    >
    > Thanks,
    >
    > David

    > From a design standpoint, that might not be the best pattern to adopt.
    To be quite honest I've never liked the idea of unloading bundles at
    all; it seems like that would be a great way to break fragile
    dependencies in code (for example, storing a callback in a struct and
    having it disappear from under your feet).  Of course, if you know
    you're going to be doing this, then you can explicitly design for it.
    Also, where is this bundle coming from, and what is its purpose?  What
    about the bundle is changing?

    > From a code standpoint, why don't you just unload the bundle and load it again?

    --Kyle Sluder
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today