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

mmm11105

macrumors newbie
Original poster
If I create a class (NSObject) and make multiple objects from it (myObject1, myObject2). How would I refer to all of them at once, say if I want them all to make left 5px or check for collisions with an object.
 
If I create a class (NSObject) and make multiple objects from it (myObject1, myObject2). How would I refer to all of them at once, say if I want them all to make left 5px or check for collisions with an object.

Make an array, and put them in the array as you create them. Then you can use a loop to loop through all of the objects. Search for "NSArray example" or "NSMutableArray example".
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.