Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Newbie Objective C developer question

I have been looking everywhere for an answer to this question - perhaps I'm looking in the wrong places. Also, I'm brand new to Objective C although I have around 10 years of experience as a developer.

for this code:

[receiver makeGroup:group, memberOne, memberTwo, memberThree];

what would the method definition look like?

- (void)makeGroup:(Group *)g, (NSString *)memberOne, ...?

Thanks for any help you can provide. I know this is probably very simple...

Thanks, R

like image 481
R.J. Avatar asked Jun 13 '26 17:06

R.J.


1 Answers

It looks like you have a method that can take a variable number of arguments. If that's the case, the definition would look something like:

- (void)makeGroup:(Group *)g, ...;

Check out NSString's stringWithFormat: or NSArray's arrayWithObjects: methods for examples.

Edit: Upon further documentation reading, it seems that you are looking at the exact example that's in the Objective-C 2.0 documentation. The declaration you're looking for is right at the bottom of page 36.

like image 82
Carl Norum Avatar answered Jun 16 '26 08:06

Carl Norum



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!