Save bool to User Defaults
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"Yes Bool"];
Copy a file from x to y
[[NSFileManager defaultManager] copyItemAtPath:x toPath:y error:nil];
Display a new view
[self presentModalViewController:(UIViewController *) animated:YES];
Screen touches method
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {}
Get documents directory
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
Load URL
[MyWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://couleeapps.hostei.com"]]];
Get Current Date and time:
NSCalendar *gregorian = [NSCalendar currentCalendar];
NSDateComponents *dateComponents = [gregorian components:(NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit) fromDate:[NSDate date]];
Own enum type:
typedef enum {
a = 0, b = 1, c = 2
} enumName;
Quartz draw arc
CGContextRef ctxt = UIGraphicsGetCurrentContext();
CGContextAddArc(ctxt, x, y, radius, startDeg, endDeg);