I have two view controllers in my app and both views have table view in them and both table views have certain buttons in them representing some images.when i select a button from table view in view 1 then image corresponding to that button is to set on the button1 in table view in view 2.How can i do it.How can i pass image from a view to other .Please respond.
Thanks,
Christy
This is what named properties are useful for.
Let’s say view 2 has this (among other things):
And then
Then elsewhere (ie wherever you’re creating your instance of this view controller) you can say:
And you’ve now initialized your view two instance with a pointer to that same UIImage in its
.viewTwoImageproperty. ViewTwo can then use that image for whatever it’s useful for, in its-(void)viewDidLoadmethod.