NSSet containsObject

Discussion in 'iOS Programming' started by counciler, Jan 19, 2011.

  1. counciler
    Expand Collapse
    macrumors newbie

    Jan 8, 2011
    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:

    //Trying to detect the entire array.
    if([touches containsObject: fooArray]
    //Trying to detect the individual object in the array.
    if([touches containsObject: [[fooArray objectAtIndex: 0] objectAtIndex: 0]];
    //Trying to detect an independent object outside of the array.
    if([touches containsObject: fooInstance;
    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"?

Share This Page