I have to make som changes to a iPhone app…
How can i change the background on a UIViewController on load (viewDidLoad) .. I have to show a .png from a URL .. Is that posible?
I have tried:
NSURL *url = [NSURL URLWithString:@"http://url_to_my_project/xmas-bg-test.png"];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *image = [UIImage imageWithData:data];
self.view.backgroundColor = [UIColor colorWithPatternImage:image];
this is from my : “- (void)viewDidLoad” method .. Nothing happend when I start my app.. no errors ether.
I have also tried from my .. viewDidAppear
You have to create
UIImageViewas a background image. Removeself.view.backgroundColor = ...line and add this:in
viewDidLoad:method.