有没有办法将命令行选项从Xcode传递到我的iOS应用程序? [英] Is there a way to pass command line options to my iOS app from Xcode?
本文介绍了有没有办法将命令行选项从Xcode传递到我的iOS应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望在测试期间启动它时找到将某些信息传递到我的应用程序的方法,以便我可以执行特殊的调试任务。 Xcode有一个部分在启动时传递的参数,我假设它们将显示在我的UIApplicationDelegate的应用程序中:didFinishLaunchingWithOptions:但是传入的字典总是为零。
I'm hoping to find a method to pass certain information in to my app when I launch it during testing, so that I can perform special debug tasks. Xcode has a section "Arguments Passed on Launch", and I assumed they would show up in my UIApplicationDelegate's application:didFinishLaunchingWithOptions: but the dictionary that's passed in is always nil.
我的方法是错误的吗?
推荐答案
你可以使用 NSProcessInfo
这样的对象访问它们,
You can access them using NSProcessInfo
object like this,
NSArray * arguments = [[NSProcessInfo processInfo] arguments];
这篇关于有没有办法将命令行选项从Xcode传递到我的iOS应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文