[英]Can I get markdown file's contents in Objective-C?
I can get the contents of a .txt file in this way: 我可以通过以下方式获取.txt文件的内容:
NSString *articlePath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@".txt"];
return [NSString stringWithContentsOfFile:articlePath encoding:NSUTF8StringEncoding error:nil];
However,it is no use when the file is a markdown file: 但是,当文件为降价文件时,则没有用:
NSString *articlePath = [[NSBundle mainBundle] pathForResource:@"test2" ofType:@".md"];
return [NSString stringWithContentsOfFile:articlePath encoding:NSUTF8StringEncoding error:nil];
The articlePath
is "nil",but the file is exist actually. articlePath
为“ nil”,但该文件实际存在。
I wonder if there any method I can use to get the contents of a .md file. 我想知道是否可以使用任何方法来获取.md文件的内容。
Thanks in advance. 提前致谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.