0

In the viewDidLoad, I have an initial setup like this -

// Output all the appropriate text to UITextLabel depending on the state of the app
[self presentData];

// Button sizing 
UIelement.frame=CGRectMake(blah blah blah);

Why is it that when I do it in the previous order, I get the text outputted without the size adjusting until present data is called again by another function while when I type the code in the order of

UIelement.frame=CGRectMake(blah blah blah);
[self presentData];

it will size it appropriately to start. I understand that the order is important but what I want to know is why? How would I go about finding out why something like this happens the next time I have a problem like this? my guess is that presenting the data, changing the uilabel, updates the view but for some reason cgrectmake does not update the view but just changes the value of the uilabel's frame in the model. Am I correct? How would I go about finding the answer to a question like this without having to ask the online community next time?

4

1 に答える 1