Using images and css file for a generated HTML UIWebView
Posted
by Tom
on Stack Overflow
See other posts from Stack Overflow
or by Tom
Published on 2010-03-24T19:11:00Z
Indexed on
2010/03/24
19:13 UTC
Read the original article
Hit count: 313
Hi!
I'm generating an HTML file for an app, and in this HTML file there's a link to a stylesheet and one to an image.
Here's what I tried so far:
NSMutableString *toReturn = [NSMutableString stringWithCapacity:100];
NSString *cssPath = [[NSBundle mainBundle] pathForResource:@"etapes.css" ofType:nil];
[toReturn appendFormat:@"<html><head><title></title><link href=\"%@\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" /></head><body>", cssPath];
It generates the right full path to the right file, this is okay if I want to access it on my mac, but on the simulator or my iPhone it doesn't point to the right place at all...
Do you have any idea of how could I make this?
Thanks
© Stack Overflow or respective owner