如何在运行时区分xcode中的多个目标 [英] How can I differentiate between multiple targets in xcode at runtime

查看:202
本文介绍了如何在运行时区分xcode中的多个目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个旧的目标c应用程序中工作,在其中我需要创建多个目标.问题是如何在代码中的多个目标运行时之间进行区分,因此需要从捆绑中加载资源.

Working on an old objective c application where in I need to create multiple targets. Question is how do I differentiate between multiple targets run time in the code and accordingly I need to load the resources from bundle.

推荐答案

您可以使用@matloob的答案.下面是另一种方法.

You can use @matloob's answer. Below is an another approach.

您还可以使用预处理"来区分目标.

You can also use Preprocessing for differentiating among targets.

请查看以下教程.这也可能对您有帮助.

Please have a look at following tutorial. This may also help you.

参考: 动态目标区分-Appcoda

这篇关于如何在运行时区分xcode中的多个目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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