The is the completion code of the code that animates squareOne
. When it is clicked it becomes hidden. If the index of the image squareOne
uses, is the same as icon
and if squareOne
is hidden, then the animation repeats. (This is the condition I want the score to increase on). If squareOne
isn't clicked at all it will still repeat.
completion:^(BOOL complete) {
if (complete) {
[self squareOneColour];
[self squareOneMover];
if (self.squareOne.hidden==YES) {
if (a==b) {
[self squareOneColour];
[self squareOneMover];
//I want the score to increase here
} else if (a!=b) {
[self squareOneColour];
[self squareOneMover];
NSLog(@"square one isn't supposed to be pressed");
}}}}];} //Just to make more compact
When I try doing this I always create dozens of NSString
and NSUInteger
variable and I think my way is inefficient, and it doesn't work... Can anyone help me get the integerValue
of the textfield score
to increase every time squareOne
is pressed and matches the image on icon
?