Friday, October 11, 2013

Get debug console log in iOS

- (NSString *)getConsoleLogFilePath {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
if (!documentsDirectory) {
NSLog(@"Documents directory not found!");
return nil;
}
return [documentsDirectory stringByAppendingPathComponent:fileName];
}


NSString *fileName = @"xx.log";
NSString *logFilePath = [self getConsoleLogFilePath];
freopen([logFilePath cStringUsingEncoding:NSASCIIStringEncoding],"a+",stderr);




No comments:

Create a list in SwiftUI with sticky section headers

 Sample Code import SwiftUI struct ContentView : View {     @State var isCustomViewControllerDisplayed = false     @State private va...