Currently we’re successfully loading Unity from within an existing iOS app. You can use the app like normal, and with a button press it loads an entire Unity “module” in a new UIWindow.
We used this as our inspiration:
http://technology.blurst.com/a-cocoa-based-frontend-for-unity-iphone-applications/
To communicate between Unity and iOS, we used this as our inspiration: http://www.tinytimgames.com/2010/01/10/the-unityobjective-c-divide/
It all works rather well, except, when the Unity module finishes with it’s scene and the user is returned back to the native app the memory usage/allocation never returns back to pre-Unity load values!
The project is written in ARC, but we overrode the class where Unity gets loaded from and manually released the UIWindow and appropriate references to no avail. In Unity, we also advanced the content to a new blank scene to encourage garbage collection to clean up the previous animations - which helped quite a bit, but it seems Unity takes up a decent amount of memory just to “exist”.
Are we missing something here? Anyone have any suggestions to reduce memory consumption or properly release Unity? Is it possible to just load Unity in a UIView instead of a full blown UIWindow?