Objective C Default parameters?

Posted by Brian Postow on Stack Overflow See other posts from Stack Overflow or by Brian Postow
Published on 2010-03-12T21:36:20Z Indexed on 2010/03/12 21:47 UTC
Read the original article Hit count: 455

I'm writing a C function in Objective C. I want a default value for my last parameter.

I've tried:

foo(int a, int b, int c = 0);

but that's C++

I've also tried

foo(int a, int b, int c)
{
...
}

foo(int a, int b)
{
   foo(a, b, 0);
}

But that's ALSO C++.

is there a way to do this in Objective C?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about default-value