How can I log names of each called class method in Objective-C? [duplicate]
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This question already has an answer here: Call a macro every time any method is called - Objective C 4 answers When I want to see the order of the object method calls, I have to put logs each method I implemented like this. - (void)updateTime:(float)time { NSLog(@"%s", __PRETTY_FUNCTION__); Hence I have to put this code in every method on the class, and it's very boring to insert and delete so many log function calls every time I am debugging a class. So how can I trigger NSLog(@"%s", __PRETTY_FUNCTION__); in a class on each method call?