[英]Can I get markdown file's contents in Objective-C?
我可以通過以下方式獲取.txt文件的內容:
NSString *articlePath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@".txt"];
return [NSString stringWithContentsOfFile:articlePath encoding:NSUTF8StringEncoding error:nil];
但是,當文件為降價文件時,則沒有用:
NSString *articlePath = [[NSBundle mainBundle] pathForResource:@"test2" ofType:@".md"];
return [NSString stringWithContentsOfFile:articlePath encoding:NSUTF8StringEncoding error:nil];
articlePath
為“ nil”,但該文件實際存在。
我想知道是否可以使用任何方法來獲取.md文件的內容。
提前致謝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.