According to Guides and sample codes ...
1. Cocoa loading Programming Topics > Multi-Bundle Application
Additionally, Cocoa applications cannot unload bundles. If you want to be able to load and unload large separately built application components, you can build your application as a number of smaller executable components, and the main application can fork child processes. You can enable communication between the processes with the Cocoa distributed objects architecture. For more information, see Distributed Objects.
2. Cocoa loading Programming Topics > Document Revision History
Removed limitations item claiming that Cocoa bundles cannot be unloaded.
Which is right?
I want to unload the dynamic bundle in a cocoa application. The bundle uses the NSWindowController to pop up and exit the Window.
However, when I unload the bundle, an EXC_BAD_ACCESS (objc_loadweakretained) error occurs.
If not, please give me another way to do the same thing.
Thank you.
There are limited circumstances under which a bundle can be unloaded but unloading a bunch containing general-purpose Objective-C code is not safe.
My general advice on this front is to not worry about unloading your bundles. A quiescent bundle should not have a big impact on your app. It’s only significant resource is its code, and that is paged in by the VM system and thus the memory can be recovered by the VM system.
Other than recovering resources, is there some other reason you need to unload this bundle?
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"