I'm having problems with setNeedsDisplay. I have a UIView with a lot of sub UIViews created in Inteface Builder. I also have a button with IBAction. In this IBAction, I want to redraw / reload all UIViews (or all UIElements, e.g. UILabel, UIWebView, etc.).
I do this, which does not work for me, I donβt know why ..:
What to do to redraw / reload / update all UIElements / UIViews and Subviews?
EDIT 1:
How to load a view:
detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController_iPad" bundle:[NSBundle mainBundle]];
There is no view manager in the detailview controller, just uiviews, here is the hierarchy:
- Uiview
- UIViewContainer
--- UIView0
--- UIView1
--- UIViewStapel
What I expect to do:
* I do not want to reset UIView, I want to change the background and their contents. *
In my detailed view, I have many subheadings (uiviews), see hierarchy above. I show the content in UIViews, the content comes from coreData.
View1 contains the current coreData row.
View0 contains the previous line of coreData.
ViewStapel contains the following line coreData.
With IBAction, I want to iterate over the coreData strings, display the next row in the current one if the action is called ... and so on.
In the log, data changes but is not displayed in UIViews. To do this, I need to redraw or reload or something like this to display the current data.
EDIT 2: SOLVE
I put the code in a new method, and calling this method solved my problem.