Sunday, April 20, 2014

Objective C pre-processor macros

Below is a list of pre-processor macros available in objective C.

__func__ => prints the current function signature
__LINE__ => prints the line number in the source code file
__FILE__ => path source to the source file
__PRETTY_FUNCTION__ is similar to __func__ but just that it is a gcc extension that prints the "pretty" name of the function including its signature. Used in C++.

When running the same in iOS code, it appears the __func__ and the __PRETTTY_FUNCTION__ give the same result

references:
https://developer.apple.com/library/ios/qa/qa1669/_index.html



No comments:

Post a Comment