0
我可以得到一個.txt文件的內容是這樣的:我可以得到降價文件的Objective-C中的內容?
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
是「無」 ,但文件實際上是存在的。
我不知道是否有任何方法,我可以用它來獲得一個.MD文件的內容。
在此先感謝。
呀,你是right.But我仍然搞不清楚爲什麼.txt文件中添加全自動但.MD文件沒有。 –
當您添加資源,確保不只是複製項目到目的地組的文件夾(如果需要)被選中,而且蜱在添加到目標列表中的相應目標。 –