我试图在 UITextView 中显示一个实现文件(.m 文件中的代码)。下面是我使用的代码片段。但它返回零。
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"TextCheck.m" ofType:@"m"];
最佳答案
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"TextCheck.m" ofType:@"m"];
将代码替换为以下行:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"TextCheck" ofType:@"m"];
关于ios - 如何在 iOS 中将 .m 文件读取为 NSString,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31245653/