In Xcode, I'm trying to make a button that changes it's text, relative to what the text currently is. For example: If the button says "1" and it is pressed, I want the text to change to "2" and "2" to "3" and so forth, here's the snippet of code that's giving me trouble:
if (magicButton.titleLabel = @"1") {
[magicButton setTitle:@"2" forState:UIControlStateNormal];
}
Xcode gives me this error "Assignment to readonly property" on line one of the snippet. I'm pretty new to Objective-C and iPhone App development, so maybe it's something crazily obvious and simple. Please don't mind if that's the case.
Here's a paste of my implementation file if it would help at all.
Thanks in advance.