I have a UIViewController called simple ViewController. I want it so that when the user presses a button on screen it shows them the code for ViewController.m. How can I do this? I tried
NSString *contents = [NSString stringWithContentsOfFile:@"ViewController.m" encoding:NSUTF8StringEncoding error:nil];
NSLog(@"%@",contents);
But it keeps returning nullAny ideas?
You would need to package the .m file as a resource to be copied into the main bundle of your application during the appropriate build phase and then read it from the bundle to display.