Pixate / pixate-freestyle-ios

Pixate Freestyle for iOS
Apache License 2.0
848 stars 134 forks source link

UIButton - setting title label text in ViewWillAppear does not work when Pixate is active #105

Closed ericrisler closed 10 years ago

ericrisler commented 10 years ago

Strange behaviour when Pixate Freestyle (2.1.2) is active:

I set a titleLabel.text property of a UIButton in viewWillAppear and the result is that the UI does not show the updated text. Instead, the text that is set in Interface Builder is displayed.

// title in IB is @"DEFAULT"
-viewWillAppear:... {
   if (myCondition) {
     self.myButton.titleLabel.text = @"title if true";
   } else {
     self.myButton.titleLabel.text = @"title if false";
   }
}

In the above, the GUI displays @"DEFAULT" as the title. If I disable Pixate Freestyle it works as expected.

We have NO css class or id or other set on the button and no entries in the stylesheet so this should just be a vanilla button.

iOS7.0+ iPad Mini. Pixate Freestyle 2.1.2

Any suggestions?

ildarsharafutdinov commented 10 years ago

just guessing:

[myButton setTitle:@"my text" forState:UIControlStateNormal];

ericrisler commented 10 years ago

Brain fart - thanks @ildarsharafutdinov - worked great - I tend to forget that about UIButtons.