iphone - 如何访问 iPhone 应用程序目录并在那里存储图像文件

标签 iphone objective-c cocoa-touch

我想知道我是否可以访问安装我的应用程序的目录。 此外,我想在同一目录中创建一个子目录,以存储我在应用程序中捕获的所有图像。我还想使用 iPhone 的默认图像查看器查看图像。这能做到吗?

最佳答案

NSString *appFolderPath = [[NSBundle mainBundle] resourcePath];

NSFileManager *fileManager = [NSFileManager defaultManager];  
NSLog(@"App Directory is: %@", appFolderPath);
NSLog(@"Directory Contents:\n%@", [fileManager directoryContentsAtPath: appFolderPath]);

关于iphone - 如何访问 iPhone 应用程序目录并在那里存储图像文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/516215/

相关文章:

iphone - 游戏中心在完整版和精简版之间

objective-c - Cocoa:绑定(bind)到复合对象并观察子属性

ios - NSKeyedArchiver 保存 iOS

ios - 无法浏览媒体服务器中的歌曲

ios - dequeueReusableCellWithIdentifier 不起作用

iphone - 内存问题还是其他什么问题?

iphone - UITabBarController提供的模态viewController

iphone - 使用NSScanner查找短语的下一个匹配项

android - 从 iOS 中的 ([self performSelectorOnMainThread]) 等非 Activity 对象访问 UI-Thread

iphone - iPhone Web 服务有理想的传输格式吗?