访问Objective-C中的命令行参数 [英] Accessing command line arguments in Objective-C

查看:121
本文介绍了访问Objective-C中的命令行参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关这些函数的完整文档( crt_externs.h ):
_NSGetArgc _NSGetArgv
我无法在苹果网站上获得有关此函数的任何文档。

Is there any complete documentation (the interface is present in crt_externs.h) about this functions : _NSGetArgc and _NSGetArgv I can't get any documentation on the apple website about this functions.

推荐答案

如果你需要做的是在Cocoa中获取命令行参数,你可以这样做:

If all you need to do is get the command line arguments in Cocoa, you can do:

NSArray *arguments = [[NSProcessInfo processInfo] arguments];

这篇关于访问Objective-C中的命令行参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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