Reputation: 2563
If I create a C style function in an objective C class, will the function be a class level method? Or an instance method?
Thanks in advance
Upvotes: 0
Views: 264
Reputation: 12988
If you create a C function in Objective-C, it will not have any relationship to a particular class. That is, it will be in the global namespace. An example of this from the SDK is NSLog(...)
.
Upvotes: 3
Reputation: 410582
You can't attach C functions to an Objective-C class. If you want a "function" attached to a class, you have to declare it as a class method. Or you can declare the function outside of the class.
Upvotes: 0