0

现在我在 Three20.. 我正在使用两个图像源来加载图像..这意味着

一种来自本地文件夹的图像。即来自应用程序文件夹的图像其他来自 url..我的问题是我不知道如何从本地文件夹加载图像..并显示它...

我的代码如下...

 BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:mpngPath];
    if(fileExists==YES)
    {

        NSLog(@"image is present");

        //load and display??


    }


    else {
        NSLog(@"image is  not present");
              }
4

2 回答 2

0

像这样:

[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"filename" ofType:@"png"]];
于 2011-07-13T09:08:33.243 回答
0

将 url 替换为您的照片路径。我假设您将图像保存在文档目录中。

 [NSString stringWithFormat:@"documents://%@",yourPhotoName];
于 2011-07-13T09:26:46.480 回答