Reputation: 11340
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 null
Any ideas?
Upvotes: 0
Views: 212
Reputation: 31026
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.
Upvotes: 1