UIWebview isn't displaying content I want it to display

Posted by Knodel on Stack Overflow See other posts from Stack Overflow or by Knodel
Published on 2010-06-05T12:28:03Z Indexed on 2010/06/05 12:32 UTC
Read the original article Hit count: 200

Filed under:
|
|

In my app I have a UIWebView which loads different rtf files. I use this function to load these files:

- (void)loadFile:(NSString*)file
{
NSString* resourcePath = [[NSBundle mainBundle] resourcePath];
NSString* sourceFilePath = [resourcePath stringByAppendingPathComponent:file];
NSURL* url = [NSURL fileURLWithPath:sourceFilePath isDirectory:NO];
NSURLRequest* request = [NSURLRequest requestWithURL:url];
[webview loadRequest:request];
}

The UIWebView displays nothing. When I enter the debugger, the file string value is which I need, but resourcePath and sourceFilePath values are "nil". What am I doing wrong?

Thanks in advance!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c