Cocoa - Defining a global function such as NSLog

See this post and accepted answer:

In Xcode, is there a way to disable the timestamps that appear in the debugger console when calling NSLog?

How can I, for this example or any other situation, declare a global function that includes objective-c calls that I can call directly, such as NSLog, without having to make a call, such as [MyClass myFunction]?

+5
source share
1 answer

Just use the standard C syntax; remember, Objective-C is a strict superset of C.

.hWrite an ad in the file

extern return_type function_name(argument_type1 argument_name1,argument_type2 argument_name 2);

.m ( .c - ),

return_type function_name(argument_type1 argument_name1,argument_type2 argument_name 2){
      ....
}

.m, @implementation ... @end. (, , .) !

+6

All Articles