Iphone 显示本地的图片

  NSString *homeDirectoryPath = NSHomeDirectory();

    NSString *imagePath = [homeDirectoryPath stringByAppendingString:@"/graph.png"];

    NSLog(@"Image: %@", imagePath);

    if (![[NSFileManager defaultManagerfileExistsAtPath:imagePath isDirectory:NULL]) 

    {

        UIImageView * myImageView = [[UIImage allocinitWithContentsOfFile: imagePath];

        //[[NSFileManager defaultManager] createDirectoryAtPath:imagePath attributes:nil];

 

        [self.view addSubview:myImageView];

        [myImageView release];

    }    

原文地址:https://www.cnblogs.com/fly_binbin/p/2160786.html