【发布时间】:2011-09-30 13:53:15
【问题描述】:
所以我成功地从数据库中检索了我的 BLOB 图像并将其设置为 NSData *content..
content = [[NSData alloc]
initWithBytes:sqlite3_column_blob(query, 16)
length:sqlite3_column_bytes(query, 16)];
我要做的是将此内容放入 NSString,因为我想将此字符串传递给 javascript 并显示图像。我不确定这是否可能,但我在下面的链接中读到,您可以在 base64 中显示 css/html 中的图像。 http://mark.koli.ch/2009/07/howto-include-binary-image-data-in-cascading-style-sheets-css.html
我遇到的问题是将我的 NSData 转换为 NSString,这样我就可以将其放入我的 UIWebView 的 loadHTMLString....我不能使用 UIImage,必须是 UIWebView。
谢谢! 格雷格
【问题讨论】:
标签: uiwebview nsstring blob nsdata