views:

68

answers:

1

I would like to trace out all messages sent by the Objective-C runtime to a particular class, say UITableView (or a particular instance) so I can better understand the inner workings of some classes. Is there a way to do this?

Another use case is to trace out all delegate methods that are being called (say UITableViewDelegate methods) without having to declare them and put a trace method in each of them.

+1  A: 

This may be a little heavy-handed, but try setting the NSObjCMessageLoggingEnabled environment variable to YES. That will show all the messages sent to every object, but you can easily filter it down to the messages sent to a particular class.

Some good tips here: http://www.dribin.org/dave/blog/archives/2006/04/22/tracing_objc/

Disclaimer: I'm not sure if the environment variable works for iPhone.

kperryua