text of a UILabel
I need to find the text of a UILabel in XCode. Here is my code. Points is the name of the UILabel.
if ((points.text == "50")) {
[ball2 setHidden:NO];
}
xcode-OTHER, OS X Mountain Lion (10.8.4)
I need to find the text of a UILabel in XCode. Here is my code. Points is the name of the UILabel.
if ((points.text == "50")) {
[ball2 setHidden:NO];
}
xcode-OTHER, OS X Mountain Lion (10.8.4)
Use isEqualToString method to compare strings.
if ([points.textisEqualToString:@"50"]) {
[ball2 setHidden:NO];
}
This does not work
Have you tried setting a breakpoint and inspecting the values involved?
How about using some NSLog statements to display the values and/or show the statement execution order?
Also, show the definition of the variables involved.
No because I don't know how to do that
Review the Xcode help.
Those are basic debugging techniques that you must learn.
but the code does not work
May you forgot creating Outlets for the label and if you created make sure it is associated with the UILabel to filesowner, other than it won't work.
I solved it, I had to move the if statement
text of a UILabel