如何登录资源文件夹中的文件?

时间:2011-05-16 07:11:42

标签: iphone

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *logPath = [documentsDirectory stringByAppendingPathComponent:@"console2.log"];
    freopen([logPath cStringUsingEncoding:NSASCIIStringEncoding],"a+",stderr);

'通过此代码,我可以在应用程序路径(应用程序支持 -

)中的日志文件中获取日志
  

iPhone模拟器 - > ...),但我希望日志文件中的日志存在于资源文件夹中。我该怎么做?'

1 个答案:

答案 0 :(得分:1)

如果你引用了应用程序自己的资源文件夹,那么这是不可能的,因为这是写保护的。您可以在模拟器上调整权限,但是当您在设备上进行测试时,它将失败。