Dynamically retrieving current method's name

前端 未结 3 2034
谎友^
谎友^ 2020-12-25 14:56

I\'d like to be able to put trace messages of the current class name and method name for all classes in my project.

Is there a way to get the current method\'s name

3条回答
  •  伪装坚强ぢ
    2020-12-25 15:38

    EDITED: i think this method is more generic...check it out..

    NSLog(@"%s", __PRETTY_FUNCTION__);
    

提交回复
热议问题