开发者

How to read "a b.txt" in bundle directory iOS

I hav开发者_StackOverflow社区e a problem right now. I want to read content of file which one have space in file name like "a b.txt" in budle directory. How to do that?

Thanks before. Regards.


NSString* filePath= [[NSBundle mainBundle] pathForResource:@"a b" ofType:@"txt"];
NSString* txt= [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];

The space in the filename should not cause a problem.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜