简体   繁体   English

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

[英]How do I find filenames of files in my iPhones Documents folder?

How do I get the last part of the filename in the Documents folder on the iPhone SDK. 如何获取iPhone SDK上Documents文件夹中文件名的最后一部分。

/Users/user/Library/Application Support/iPhone Simulator/5.0/Applications/apptext/Documents/File.txt / Users /用户/图书馆/应用程序支持/ iPhone Simulator / 5.0 / Applications / apptext / Documents / File.txt

I want the part that says File.txt, and ignore the rest of the path, how would I do that using the iPhone SDK? 我想要显示File.txt的部分,而忽略其余的路径,如何使用iPhone SDK做到这一点?

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

NSString *name = [path lastPathComponent];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将文件放入xcode的Documents文件夹中以进行iPhone开发? - How do I put files into the Documents folder in xcode for iPhone development? 如何阻止iPhone调整背景图片的大小? - How do I stop iPhones from resizing my background images? 如何获取应用程序中给定目录中所有文件的NSArray文件名? - How do I get an NSArray of filenames of all files in a given directory in my app? 如何通过iTunes将文件复制到我的应用程序的“文档”文件夹中 - How can I copy files to Documents folder of my app through iTunes 如何(什么?)我需要做什么来测试其他iPhone上的iPhone应用程序? - How (what?) do I need to do to test my iPhone app on other iPhones? 如何使我的背景图片具有响应性,以便在iPhone和Android上正确显示 - How do I make my background-image responsive so that it displays properly on iphones and android 如何允许我的应用访问iphone联系人并将其存储以在应用中使用 - how do I allow my app to access iphones contacts and store them for use in app 如何使用XMLVM访问iPhone应用程序的Documents文件夹 - How do I access the iPhone applications Documents folder using XMLVM 如何在越狱的iPhone上安装任意.app iPhone应用程序? - How do I install arbitrary .app iPhone applications to jailbroken iPhones? 如何在新旧iPhone上获得一致的速度? - How do I get a consistent speed on new as well as old iPhones?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM