作者:卧龙先生八斗才 | 来源:互联网 | 2023-05-17 12:00
This question already has an answer here:
这个问题在这里已有答案:
- How do I access program arguments in Swift? 5 answers
如何在Swift中访问程序参数? 5个答案
I'm writing a command line app using Swift but I'm not sure how to get access to the arguments passed in. In C/Obj-c it seems relatively painless but if I try:
我正在使用Swift编写一个命令行应用程序,但我不确定如何访问传入的参数。在C / Obj-c中它似乎相对无痛但是如果我尝试:
argv[0]
I get an error: Use of unresolved identifier 'argv'
我收到一个错误:使用未解析的标识符'argv'
1 个解决方案