简体   繁体   English

在uiimageview中显示来自sqlite数据库的图像

[英]show image from sqlite database in uiimageview

I have stored image path in sqlite and I successfully fetched image path from the database. 我已将图像路径存储在sqlite中,并成功从数据库中获取了图像路径。 I stored it in a string. 我将其存储在字符串中。 I print the path in the console which is as follows: 我在控制台中打印路径,如下所示:

2012-10-26 11:54:37.888 valvolineApp[1211:207] Image path:/Users/shufflelabs/Library/Application Support/iPhone Simulator/5.0/Applications/6B6D67DB-92AB-48C5-856B-861423FB22F4/valvolineApp.app/11_fuel system service.jpg

but now how to show the respective image in the uiimageview? 但是现在如何在uiimageview中显示相应的图像?

I am very confusing here. 我在这里很困惑。

share the idea if you have 如果有的话,分享想法

thanx... 谢谢...

Try this 尝试这个

 UIImage *img = [UIImage imageWithContentsOfFile:(the file path)];
 UIImageView *imgView = [[UIImageView alloc] initWithImage:img];

If u still facing problem similar posts are seen below. 如果您仍然面临问题,则可以在下面看到类似的帖子。

programmatically-show-image-in-uiimageview-iphone 在uiimageview iphone中以编程方式显示图像

dispay-image-in-uiimageview 在uiimageview中支付图像

how-to-display-images-in-imageview-in-iphone 如何在iPhone的图像查看中显示图像

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM