Recording TRACE on iPhone

I am new to the iPhone and trying to find out the sequence of methods called during application loading.

After some Google search, I found this seems appropriate: NSLog (@ "Start% @initWithNibName", [[self class] description]); But is there a way to insert a method name instead of typing it yourself? Is there even the best TRACE magazine team ???

In addition, I found this on the Internet:

#define METHOD_LOG (NSLog(@"%@ %s\n%@", \
    NSStringFromSelector(_cmd), __FILE__, self))

But I do not know what he is doing and how to use it. I tried: - (id) init {METHOD_LOG ("INIT"); ......}

But it does not compile.

+3
source share
1 answer

I use this to register the current method or function (works for both):

NSLog(@"%s", __FUNCTION__);

, , :

METHOD_LOG;
+5

Source: https://habr.com/ru/post/1776124/


All Articles