Embed Image in Html and Load in UIWebView

DAlaurinda

New Member
I know how to load the images in WebView, now I am trying to embed an image in html and load in UIWebView.The following are the code which I am using,\[code\]NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);NSString* documentsDirectoryPath = [paths objectAtIndex:0];NSString* folderPath = [documentsDirectoryPath stringByAppendingPathComponent:@"iOSDevices"];NSArray* filesCount = [[NSFileManager defaultManager ] folderPath error:nil];NSString* path = [NSString stringWithFormat:@"%@/%@",folderPath,[filesCount objectAtIndex:0]]; NSString *htmlString = [NSString stringWithFormat:@"<html><body><img src=http://stackoverflow.com/"%@\" type=\"jpg\" width=\"320\" height=\"480\"></body></html>", path]; [_webView loadHTMLString:htmlString baseURL:nil];\[/code\]Am I missing something ?
 
Back
Top