Davido
Davido

Reputation: 2931

Why does touchesBegan not fire when the number of touches changes?

For some reason my touchesBegan method doesn't seem to be responding correctly. If I touch the screen with two fingers, then lift one up and put it down again, touchesBegan gets called correctly. If I touch the screen with one finger, then add a second finger, touchesBegan does not get called like it should. Is there some flag that I need to check? Below is a sample that illustrates my problem:

-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
     NSLog(@"touch");
}

Any ideas what's going on? I'm testing on an iPad with iOS 4.2 if it matters.

Upvotes: 4

Views: 1802

Answers (1)

David Gelhar
David Gelhar

Reputation: 27900

Yes, you need to set the multipleTouchEnabled property on your view.

When set to NO, the receiver receives only the first touch event in a multi-touch sequence. The default value of this property is NO.

Upvotes: 9

Related Questions