gpt4 book ai didi

cocoa - 找出 Foundation 可执行文件中的工作文件夹?

转载 作者:行者123 更新时间:2023-12-03 17:30:54 29 4
gpt4 key购买 nike

我有一个控制台程序,它链接到 Mac 上的 Foundation 框架。如何找到可执行文件所在的文件夹

最佳答案

即使该工具不在 bundle 中,您仍然可以使用一些 NSBundle 方法。例如:

NSString * binaryPath = [[NSBundle mainBundle] executablePath];
NSString * executableFolder = [binaryPath stringByDeletingLastPathComponent];

关于cocoa - 找出 Foundation 可执行文件中的工作文件夹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3355310/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com