I have a game where each level has its own logic,so its a module with level -specific code and graphics. I am confused on whether its possible to download and integrate dynamically in the app each level. Searching the web , i found that nsbundle is the standard way for performing this task,however loadable bundles are not supported in iOS. Is there a way to approach such a task,and if yes ,its not clear to me if its even permitted by Apple
Why do not you want just hide all extra levels in your app and unlock/show them instead of downloading? By the way, apple will not allow you plugging in any code that is not approved by them.
Thechnically, it's possible by simply saving the files you want into the document folder of your app.
You can get this path with:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *path = [paths objectAtIndex:0];
Then use whatever API to write your levels there.
Now while you are allowed to download additional assets, you are not allowed to download additional code. But I'm unclear on this, I know an app that download some .lua script files and never had any trouble with Apple. For the legal side, you'll have to trust someone else.
EDIT: By code, I mean compiled code (like a dylib), while using dlopen of the iPhone may work, it's not allowed or documented.