Reputation: 1542
I have file on local desktop.
I'm converting its url by using [NSURL fileURLWithPath:filePath]
but I'm getting error. Here is my code:
NSString* filePath = @"/Users/Desktop/bb.ppt";
[powerWeb loadData:[NSData dataWithContentsOfFile:filePath]
MIMEType:@"application/vnd.ms-powerpoint"
textEncodingName:@"utf-8"
baseURL:[NSURL fileURLWithPath:filePath]];
It is giving me this error:
error:::Operation could not be completed. (NSURLErrorDomain error 100.) error:::Frame load interrupted.
Upvotes: 1
Views: 789
Reputation: 36
The following may work for you:
[[NSBundle mainBundle] URLForResource:@"mypresentation" withExtension:@"ppt];
Upvotes: 1
Reputation: 1533
I use this code to display ppt in iPhone application:
[myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:tempFilePath]]];
But it have a leak when viewing. I don't know why.
Upvotes: 0
Reputation: 79770
I suspect that this is not right:
baseURL:[NSURL fileURLWithPath:filePath]
You are using the same full path in loadData
and baseURL
parts.
Do you have a file at the location: /Users/Desktop/bb.ppt
, even if you had it there I suspect it will try to access /Users/Desktop/bb.ppt/Users/Desktop/bb.ppt
looking at the baseURL
setting.
Upvotes: 1