我确信这是一个非常基本的问题,但我很难找到关于它的任何东西。
假设我的应用程序在一个文件夹中,在更多的文件夹中,如下所示:
然后,我想要做的是访问"MainFolder“中的一个文件。我知道我可以通过使用以下命令获得AppBundle的路径:
NSLog(@"%@",[NSBundle mainBundle resourcePath]);
我不确定的是如何获得"MainFolder“的路径。
任何指针都会很棒!
谢谢,汤姆
发布于 2009-12-23 08:07:39
我会使用-[NSString stringByDeletingLastPathComponent]两次。
NSString *bundlePath = [[NSBundle mainBundle] resourcePath];
NSString *secondParentPath = [[bundlePath stringByDeletingLastPathComponent] stringByDeletingLastPathComponent];发布于 2013-05-08 00:18:35
我使用:NSString *mainBundlePath = [[NSBundle mainBundle] bundlePath];
https://stackoverflow.com/questions/1949992
复制相似问题