Do you actually need to know the touch count? I wouldn't get too hung up over it if not, as long as the object that you are interested in is registered as being touched then is that not enough?
If you have multiple objects that are to be touched at once you could calculate the amount of objects being touched by having bools for each to say if they are being touched and counting how many of the objects have their touched bool set to true.
Ive just whacked together the code below without any testing so it might not work but maybe it is something similar to that you are after?
NOTE: you will also need to add code into the touchesMoved to check when someone drags a finger out of the square or into it and modify the SquareTouchCount variable accordingly.
The SquareTouchCount variable *should* represent the amount of touches currently in the your defined rect
Code:
int SquareTouchCount = 0;
CGRect myRect = CGRectMake(60, 141, 200, 200);
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSArray * touchArray = [touches allObjects];
for (int looper = 0; looper < [touchArray count]; ++looper)
{
UITouch * touch = [touchArray objectAtIndex:looper];
CGPoint point = [touch locationInView: [touch view]];
if(CGRectContainsPoint(myRect, point))
{
SquareTouchCount++;
}
else
{
//Touch wasn't in the rect
}
}
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
NSArray * touchArray = [touches allObjects];
for (int looper = 0; looper < [touchArray count]; ++looper)
{
UITouch * touch = [touchArray objectAtIndex:looper];
CGPoint point = [touch locationInView: [touch view]];
if(CGRectContainsPoint(myRect, point))
{
SquareTouchCount--;
}
else
{
//wasn't in the rect
}
}
if ([touches count] == [[event touchesForView:[(UITouch*)[touchArray objectAtIndex: 0] view]] count])
{
// Sometimes we don't always get notified about all of the touches ending so this is a failsafe
SquareTouchCount = 0;
}
}