Is it possible to automatically create an iPhone app from another iPhone app?
Officially, no. Official applications must be compiled and signed on an OS X machine.
In practice, like - if you are not against jailbreak. For jailbroken phones, gcc and signature tools are available that run on iPhones. So on jailbroken phones, you can have an app that generates new apps. However, Apple will not allow you to sell such an app on the App Store.
source to share
I would take a look at this link which quotes the SDK:
3.3.2. [..] No interpreted code can be loaded and used in an application other than code that is interpreted and executed by the Apple APIs published by the embedded interpreter (s).
and
3.3.3 Without the prior written permission of Yablokov, the Application may not provide, unlock or permit additional features or functionality through distribution mechanisms other than the App Store.
between these two constraints, I think it would be nearly impossible to dynamically create any application on the fly (except perhaps for the concept of pure JavaScript / HTML application mentioned in the article).
source to share