Hi all,
In my app I have a custom UIView subclass (let's call it MyView) which contains three buttons and two labels. I add this view to a view controller which also has a table view (I add the instance of MyView at the bottom).
Because of the business logic rules, the labels and one button out of three are hidden in the beginning. So I do this in viewDidLoad:
self.myView.label1.hidden = YES;
self.myView.label2.hidden = YES;
self.myView.button1.hidden = YES;
which works fine. So these three are hidden and the remaining two buttons are visible.
Now this view controller is also a delegate for another class. At some point in time an event occurs in this other class which calls a notification method in my view controller.
In this notification method I have now to show the hidden controls. So I obviously tried the following:
self.myView.label1.hidden = NO;
self.myView.label2.hidden = NO;
self.myView.button1.hidden = NO;
but it doesn't work, they don't appear.
Any idea what I'm doing wrong? Do I need to somehow "repaint" self.myView after this so that the controls become visible? What am I missing here?
Many thanks in advance!
Edit
I have added some NSLogs after setting them visible and the logs show something like this:
label1.hidden = 0
label2.hidden = 0
button1.hidden = 0
So as per the logs, they should be visible.