Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

counciler

macrumors newbie
Original poster
Jan 8, 2011
25
0
I'm trying to determine if an object is being touched. I have a two dimensional array of what we'll call "foo"s called "fooArray." I've tried using NSSet's containsObject, I've tried detecting the entire array and even an individual object. Here's some specifics:

Code:
//Trying to detect the entire array.
if([touches containsObject: fooArray]
     NSLog(@"True");

//Trying to detect the individual object in the array.
if([touches containsObject: [[fooArray objectAtIndex: 0] objectAtIndex: 0]];
     NSLog(@"True");

//Trying to detect an independent object outside of the array.
if([touches containsObject: fooInstance;
     NSLog(@"True");

I take it from Apple's reference that containsObject: searches the entire NSSet for the object you specify. Unless I shouldn't be using the "touches" argument supplied with the "touchesBegan" method, then I don't know what else to use. So how do I get it to return "True"?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.