set background image for entire iPhone / iPad app

Here’s how you set a background to an image: self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@”Background.png”]]; Edit: To write up what Felixyz said (and thanks to Manni), do this in your delegate: window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@”Background.png”]]; And in each view you want to have the image, do this: self.view.backgroundColor = [UIColor clearColor];

Drawing Smooth Curves – Methods Needed

I just implemented something similar in a project I am working on. My solution was to use a Catmull-Rom spline instead of using Bezier splines. These provide a very smooth curve THROUGH a set a points rather then a bezier spline ‘around’ points. // Based on code from Erica Sadun #import “UIBezierPath+Smoothing.h” void getPointsFromBezier(void *info, … Read more

How to overwrite a file with NSFileManager when copying?

If you can’t/don’t want to keep the file contents in memory but want an atomic rewrite as noted in the other suggestions, you can first copy the original file to a temp directory to a unique path (Apple’s documentation suggests using a temporary directory), then use NSFileManager’s -replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: According to the reference documentation, this method … Read more

iPad layout scales up when rotating from portrait to landscape

—— Update —— This is not an issue anymore in iOS7. And there is better fix by Scott Jehl on github scottjehl/iOS-Orientationchange-Fix that works for iOS6. —— Original answer —— Jeremy Keith (@adactio) has a good solution for this on his blog Orientation and scale Keep the Markup scalable <meta name=”viewport” content=”width=device-width, initial-scale=1″> Then disable … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)