如何在iPhones Documents文件夹中找到文件的文件名?

时间:2011-10-23 21:12:51

标签: iphone ios file

如何在iPhone SDK的Documents文件夹中获取文件名的最后一部分。

/ Users / user / Library / Application Support / iPhone Simulator / 5.0 / Applications / apptext / Documents / File.txt

我想要File.txt的部分,并忽略路径的其余部分,我将如何使用iPhone SDK做到这一点?

1 个答案:

答案 0 :(得分:0)

NSString *path = "/Users/user/Library/Application Support/iPhone Simulator/5.0/Applications/apptext/Documents/File.txt"

NSString *name = [path lastPathComponent];
相关问题