views:

112

answers:

1

I created a view Called ProgrammaView that appears when a row of a table is clicked.

This view has a UILabel, a UIImageView and a UITextView.

Now. ProgrammaView's Outlets have to be changed by the parameter passed to a method of the view called iniz.

in this image there is first the ProgrammaView.h and then the method iniz.

The problem is that the label and other stuff doesn't change! I checked 3 million times that everything between the xib file and the controller is linked.

The trick to call iniz in the other viewcontrollers works well in other part of the program so i think is not that the problem. Thank you in advance!

A: 

You need to call setNeedsDisplay to indicate that the view should be redrawn.

My understanding is that you start up and show view after that you update the values and expect the view to display new values.

You need to call setNeedsDisplay to indicate that the view should be redrawn. Try to add it at the end of your iniz method.

See apple doc.

stefanB
so i should write [self setNeedsDisplay]; when i finish to change the attributes?
Antonio Murgia
I did it! I called iniz and then iniz copies the variable passed to a local variable and then calls viewdidload that makes the work with the parameter!
Antonio Murgia