Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
#import "SampleApp.h" @implementation SampleApp - (void) applicationDidFinishLaunching: (id) unused { UIWindow *window; struct CGRect rect = [UIHardware fullScreenApplicationContentRect]; rect.origin.x = rect.origin.y = 0.0f; window = [[UIWindow alloc] initWithContentRect: rect]; [window orderFront: self]; [window makeKey: self]; [window _setHidden: NO]; mainView = [[UIView alloc] initWithFrame: rect]; textView = [[UITextView alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 240.0f)]; [textView setEditable:YES]; [textView setTextSize:14]; kb = [[UIKeyboard alloc] initWithFrame:CGRectMake(0.0f, 245.0f, 320.0f, 200.0f)]; [window setContentView: mainView]; [mainView addSubview:textView]; [mainView addSubview:kb]; path = @"/var/root/.s1text"; [textView setText: [NSMutableString stringWithContentsOfFile:path encoding:NSMacOSRomanStringEncoding error:&error]]; } - (void) applicationWillSuspend { [[textView text] writeToFile: path atomically: NO encoding: NSMacOSRomanStringEncoding error: &error]; } @end
From the Design Piracy series on my blog: