I am doing following steps to display a html file in uiwebview.
1.unzip the .epub file, from that get html file content in a array
NSData *data=[NSData dataWithContentsOfFile:filepath];
[arrayDatacontent addObject:data];
after this process complete. Removed the unzip .epub file.
-
2.
NSData *htmlString=(NSData *)[arrayDatacontent objectAtIndex:2];
NSString *imagePath =[[NSBundle mainBundle] resourcePath];
imagePath = [imagePath stringByReplacingOccurrencesOfString:@"/" withString:@"//"]; imagePath = [imagePath stringByReplacingOccurrencesOfString:@" " withString:@"%20"]; [webview4epub loadData:htmlString MIMEType:@"text/html" textEncodingName:@"UTF-8" baseURL:[NSURL URLWithString:[NSString stringWithFormat:@"file:/%@//",imagePath]]];
from this content text loaded in the webview. But there relative images is not shown.