开发者

iphone read txt file from UIWebView

开发者 https://www.devze.com 2022-12-27 02:38 出处:网络
I can read the data in file.txt file located in local disk. NSString *filePath = [[NSBundle mainBundle] pathForResource:@\"file\" ofType:@\"txt\"];

I can read the data in file.txt file located in local disk.

NSString *filePath = [[NSBundle mainBundle] pathForResource:@"file" ofType:@"txt"];
NSString* 开发者_StackOverflow社区Data = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:&error ];

now, I upload the file.txt file into a website. how can i read the data from the txt file now from UIWebView?

Please help!!


The similar way:

NSString* Data = [NSString stringWithContentsOfURL:fileURL usedEncoding:NSUTF8StringEncoding error:&error ];
0

精彩评论

暂无评论...
验证码 换一张
取 消