此代码是Core Data的一部分。 URLsForDirectory ....方法不能在iOS < 4上运行,所以我需要知道一些其他要调用的方法/对象。我也会提供文件供将来参考。谢谢如何获取应用程序文档目录的URL iPhone
/**
Returns the URL to the application's Documents directory.
*/
- (NSURL *)applicationDocumentsDirectory
{
return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}
你需要一个URL,或者只是文件的路径? – 2011-04-09 21:40:48