如何在iPhone SDK的Documents文件夹中获取文件名的最后一部分。
/ Users / user / Library / Application Support / iPhone Simulator / 5.0 / Applications / apptext / Documents / File.txt
我想要File.txt的部分,并忽略路径的其余部分,我将如何使用iPhone SDK做到这一点?
答案 0 :(得分:0)
NSString *path = "/Users/user/Library/Application Support/iPhone Simulator/5.0/Applications/apptext/Documents/File.txt"
NSString *name = [path lastPathComponent];