2

How to link HTML string loaded from sqlite db with images stored in bundle

[self.wbvuContents loadHTMLString:self.page baseURL:nil];

self.page may be as the following:

<html>
<body>
<div  style='margin:20 0 0 0px'>  <img style=' ' alt='' height='48' src='images/01-01-018.jpg' width='75' /> 
</body>
</html>

and 01-01-018.jpg image is added to the bundle

when use the above code images not appeared in webview

1 Answer 1

2
NSString *path;
NSURL *baseURL;
path = [[NSBundle mainBundle] bundlePath];
myBaseURL = [NSURL fileURLWithPath:path];

[self.wbvuContents loadHTMLString:self.page baseURL:myBaseURL];

then, if your image 01-01-018.jpg is in your bundle :

<html>
<body>
<div  style='margin:20 0 0 0px'>  <img style=' ' alt='' height='48' src='01-01-018.jpg' width='75' /> 
</body>
</html>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.