NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *logPath = [documentsDirectory stringByAppendingPathComponent:@"console2.log"];
freopen([logPath cStringUsingEncoding:NSASCIIStringEncoding],"a+",stderr);
‘By this code i get logs in a log file present in Application Path (Application Support–
iPhone Simulator–> …), but i wanted the logs in a log file present in a resource folder. How do i do that ?’
If you a referring to the apps own resource folder, then it’s not possible since this is write protected. You may be able to tweak the permissions on the simulator but when you test on the device it will fail.