tags:

views:

66

answers:

2

Do all functions (as opposed to class/instance methods) in Objective-C use C syntax for both declaration and calling?

+3  A: 

Yes, they do. Objective-C is built on top of C, so the C syntax is valid.

e.James
+6  A: 

well, it really is C. Objective-C is a superset of C, meaning that you can use any C construct you want and the compiler will handle it. Just declare C functions as you normally would, and call them as you normally would.

darren
So I declare it/call it like a C function, but it isn't merely a c function as I can still access Objective C objects/pass messages?
Casebash
as long as your references are in scope, yes you can. e.g. if have have a global reference some objective-c object, you can send messages to it in your C function. YOu can't reference "self" though as you aren't in the implementation scope of an object.
darren