如何管理构建iPhone应用程序的Lite vs Paid版本? [英] How do I manage building a Lite vs Paid version of an iPhone app?

查看:132
本文介绍了如何管理构建iPhone应用程序的Lite vs Paid版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始想要考虑构建我的iPhone应用程序的
lite版本。我在网上发现了一些关于这个过程的讨论
的事情,即:

I'm starting to get to the point where I want to consider building a lite version of my iPhone app. I've found a few things on the web that talk about the process a bit, namely:

http://developer.apple.com/tools/XCode/XCodeprojects.html

http://www.pacificspirit.com/blog/2009/01 / 27 / building_for_multiple_iphone_targets_in_xcode

我对b $ b特别感兴趣的是简化管理
的过程,哪些文件包含在不同版本的我的应用程序,因为我
不断修改和增强我的付费版本。

What I'm specifically interested in is simplifying the process of managing which files are included in the different versions of my app as I continually modify and enhance my paid for version.

推荐答案

原始答案来自应用程序购买前几天。现在正确的答案是发送一个二进制文件,并通过在应用程序升级中提供付费版本。这是稍微多一点的代码,但它是一次发货,你的转换率可能会更好。

Original answer is from the days before in app purchase. The correct answer now is to ship a single binary and offer your paid version through in app upgrades. It's slightly more code but it's a single shipment and your conversion rate will probably be better.

但是,如果你仍然想要你的应用版本:

However, if you still want to versions of your app:

Xcode对多个目标有很好的支持。

Xcode has good support for multiple targets.

从项目菜单中选择New Target ...。添加另一个iPhone可执行文件(Cocoa Touch Application),然后您可以根据资源指定资源中的哪些项目包含在目标中。这可以包括仅将某些代码编译到付费版本中。

From the project menu select "New Target...". Add another iPhone executable (Cocoa Touch Application) you can then specify on a resouce by resource basis which items are included in your target. This can include only compiling certain code into your paid version.

通过右键单击当前目标,您可以快速获得有关当前目标中包含的内容的视觉反馈组和文件列表标题(顶部lhs)和启用目标成员资格。

You can get quick visual feedback on what is and is not included in the current target by right clicking on the "Groups and Files" list header (top lhs) and enabling Target Membership.

您可以在建立不同目标之间切换,就像在模拟器或iPhone的建筑物之间切换一样。

You switch between building different targets in the same way as you switch between building for Simulator or iPhone.

要在构建时指定特定类的行为方式,您可以做两件事 - 包括两个版本的类,每个版本都为各自的目标构建,或者,您可以设置预处理器的构建时间标志。在组和文件列表中选择目标,然后在该目标上获取信息。转到构建选项卡并搜索预处理。您应该看到一个名为预处理器宏的项目将 LITE 添加到您的精简目标,并以相同的方式添加 PAID 到您的付费目标。

To specify at build time how a specific class behaves you can do two things - include two versions of the class which are each built for their respective target or, you can set a build time flag for the pre-processor. Select the Target in the "Groups and Files" list then "get info" on that target. Go to the build tab and search for "preprocess". You should see a n item called "Preprocessor Macros" add LITE to your lite target and in the same way add PAID to your paid target.

您可以在编译时确定源文件中使用 #ifdef LITE 等。

Thein in your source files you can determine at compile time which version you are compiling for using #ifdef LITE etc.

更进一步,您可以根据#ifdef LITE设置全局标志或AppDelegate成员变量,并在运行时更改Lite和付费应用的行为。我不确定我是否看到了它的价值。

Going even further, you could set a global flag or AppDelegate member variable based on #ifdef LITE and change behaviour at runtime for the Lite and paid apps. I'm not sure I see value in that though.

这篇关于如何管理构建iPhone应用程序的Lite vs Paid版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆