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

exmorpheus

macrumors newbie
Original poster
Mar 19, 2011
4
0
I noticed some array methods like initWithObjects or arrayWithObjects allow you to keep adding arguments until you pass a null argument. So I'm wondering how I would make something similar to that. I looked at the header file in which arrayWithObjects was declared and saw this:

Code:
- (void)arrayWithObjects:(id *)firstObject, ... NS_REQUIRES_NIL_TERMINATION;

I was wondering if I could do the same with my own methods and if so, how do I call the other arguments?
 
In other languages you'd parse an array of arguments. You've then just got to work out what to do with it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.