【问题标题】:How can i see my images directory contents using finder in iPhone?如何使用 iPhone 中的 finder 查看我的图像目录内容?
【发布时间】:2011-12-06 07:29:33
【问题描述】:

我在运行时使用 iPhone 模拟器将一些编辑过的图像保存在我自己创建的应用文件夹下的目录中。现在我想在 mac finder 中查看我编辑的图像。你知道我如何在 finder 中看到我在 iPhone 模拟器运行时创建的编辑图像吗?

【问题讨论】:

    标签: iphone ios


    【解决方案1】:

    它位于~/Library/Application Support/iPhone Simulator/<OS_VERSION>/Applications/

    该文件夹通常是隐藏的,因此请使用 Finder 中的“转到文件夹...”快捷方式。

    【讨论】:

    • 我又面临一个问题。
    • 我又面临一个问题。我的 Supporting Files 组下有一个名为 Album 的目录。在这个目录中,我有一些图像。在我的图像编辑应用程序中,我想将编辑后的图像保存在我的相册目录中。我尝试使用以下代码将图像保存在我的相册目录中
    • NSString *bundleRoot = [[NSBundle mainBundle] bundlePath]; NSString *albumPath = [bundleRoot stringByAppendingString:@"/Album"]; NSString *savedImagePath = [bundleRoot stringByAppendingPathComponent: @"newImage11.jpeg" ]; UIGraphicsBeginImageContext(drawImage.image.size); CGContextRef ctx = UIGraphicsGetCurrentContext(); [drawImage.layer renderInContext:ctx]; UIImage *editedImage = UIGraphicsGetImageFromCurrentImageContext(); NSData *editedImageData = UIImageJPEGRepresentation(editedImage, 1.0); UIGraphicsEndImageContext(); [editedImageData writeToFile:savedImagePath atomically:YES];
    • 这里的 drawImage 是 UIImageView 的 IBOutlet,它保存了图像。这段代码在我的相册目录中保存了一个文件 newImage11.jpeg,它也有一个大小。但是当我从相册目录中检索图像时,它给了我一个空白图像。我使用以下代码检索图像
    • NSString *img = [onlyJPGs objectAtIndex:currentIndex+numberToAdd]; UIImage *tempImage = [UIImage imageNamed:img]; imageButton.tag = img; [imageButton setImage:tempImage forState:UIControlStateNormal]; [imageButton addTarget:nil action:@selector(goToEdit:) forControlEvents:UIControlEventTouchUpInside]; currentIndex+=numberToAdd;
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-13
    • 2013-08-19
    • 1970-01-01
    • 2018-04-19
    • 2014-03-08
    • 2011-09-03
    相关资源
    最近更新 更多