Hey!
I'm a new xcoder and I have a question.
I have image and score(label)
So i want when "Touch is moved" on image ,score goes up and when "Touch is moved" out of image,score dont go up.
I cant do that.
Please help!
CODE:
-------------------------------------------------------------------------------
I'm a new xcoder and I have a question.
I have image and score(label)
So i want when "Touch is moved" on image ,score goes up and when "Touch is moved" out of image,score dont go up.
I cant do that.
Please help!
CODE:
Code:
@interface image : UIImageView{
NSInteger score;
IBOutlet UILabel*label;}
@end
Code:
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
score = score + 1;
NSString *text = [NSString stringWithFormat:@"%d",score];
self->label.text = text;
}
Last edited by a moderator: