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文件没有。 –
当您添加资源,确保不只是复制项目到目的地组的文件夹(如果需要)被选中,而且蜱在添加到目标列表中的相应目标。 –