Skip navigation.
 
mlBundle Loading/Unloading at runtime
FROM : Rahul Shetty
DATE : Fri Jan 04 17:19:26 2008

Hi All,

  We are developing an application that has to run on both Tiger and 
the Leopard.  The application has quite a few Cocoa bundles ,each 
representing a separate service.
We have reasons to believe that the services that the bundles support 
will undergo constant update.  Hence we have a need to update the 
bundles frequently through  software update.
We want this update to take effect while the application is running.


However in terms of loading and unloading the bundles at run time, we 
would like to have the following behavior:

1. We identify the bundle that is not busy and unload it.
2. We block all further calls to the bundle
3. We download the latest bundle
3. We load the new bundle in the place of the old one
4. All this happening in the background when the application is 
running .
5. This is repeated for each of the bundle

The bundles contain mostly Objective-C code. We know that a Cocoa 
loadable bundle cannot be unloaded (the documentation under "CFBundle 
and NSBundle" talks about it) . This we believe is the crux of the 
problem.  We tried in vain to
move the Objective-C code to a carbon bundle and then use the CFBundle 
calls to load/unload the bundle . We create an Cocoa object through a 
function exported from the bundle and proceed
to access the services of the other Cocoa classes through this  .  We 
are facing random crashes even in this method. This might be due to 
the issue of the CFBundle being unable to
load and register all the Cocoa classes.

The harder option is to rewrite the bundle code in C++ and using 
CoreFoundation classes. However, we would like to keep this as the 
last option.

Can you provide us with any inputs into how we could go about solving 
the issue?

Thank you.

Regards,
Rahul.

-----------------------------------------------
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus.

Related mailsAuthorDate
mlBundle Loading/Unloading at runtime Rahul Shetty Jan 4, 17:19
mlRe: Bundle Loading/Unloading at runtime Jean-Daniel Dupas Jan 4, 17:35