开发者

Can I have an app inside another app?

开发者 https://www.devze.com 2023-02-03 19:12 出处:网络
I am having an issue integrating iPhone apps. In one of my previous posts, I asked about creating a static library from an Xcode project..

I am having an issue integrating iPhone apps. In one of my previous posts, I asked about creating a static library from an Xcode project..

As an alternative, I am searching for a way to put an app inside another app. Because both are large apps containing lot of classes, images, sound files etc. Most of the class names and resources names of the both apps are same. So the static library concept will lead to name conflicts, which is very very tedious for me to fix. So I am trying to switch to this app-inside-app concept.

Consider I am having an app. I want to put my second app inside the app by putting the ".app" file of my second app inside my first app's ".ipa" file or somewhere inside the first app. Now I want to call my second ap开发者_Python百科p from my first app to run independent of the first app.

My concept is, both my first and second apps are seperate apps. I want to put them in a single ipa file. Only one app (ie., my first app) is shown when I install the ipa file. My second app is also gets installed but its not shown, because it is inside my first app. So that I can call my second app only from my first app.

This is what I need to do..

Any suggestions..

Thanks..


You can't do this. The method of putting apps on an iphone is fairly strict about how it works. And you cannot put 2 apps in a single bundle on the app store. You would have to ship 2 apps, instruct the user to install both, and then one app could launch the other app via a registered url protocol. And that sounds lame for this case.

And as you found, ObjC's lack of proper namespacing makes merging this code sort of hard. Perhaps you could simply prefix all of the libraries classes. A simple find and replace should be able to do that. This is the general approach for sort of fake namespacing code in a C dialect that doesn't support real namespacing.

Instead of Person and Person, you would have Person in your main app code, and MLPerson in your lib where ML is a cool 2 letter prefix for your library (I abbreviated MyLib to get ML).

0

精彩评论

暂无评论...
验证码 换一张
取 消