views:

77

answers:

2

I am changing the background color from single view controller to all other view controller. but it is working only when i start with that single controller . if i started with any other controller then i am not getting background change for that controller.
I though that because if i start with some other controller , its init method is called and and changes that i am calling from single controller after going to other controller is not appear for other controller.

So how can we reinit the other controller so that changes appear in other controller also.

+2  A: 

You shouldn't re-initialize an object that's already been initialized.

I think you should consider using the viewWillAppear method which is called when a view becomes active.

- (void)viewWillAppear:(BOOL)animated

Check out the Apple documentation here

mmccomb
thanks its working for the background color
uttam
A: 

I don't think initializing is your problem, but that views are getting unloaded and reloaded which is why you're losing the changes. Debug your VC and set breakpoints on loadView and viewDidUnload methods to see if it the view is being unloaded after you have changed backgrounds.

Anurag