Question: Can I intercept a method call in Objective-C? How?

**Edit:**
*Mark Powell*'s answer gave me a partial solution, the *-forwardInvocation* method.
But the documentation states that -forwardInvocation is only called when an object is sent a message for which it has no corresponding method. I'd like a method to be called under all circumstances, even if the receiver does have that selector.

Answer: 
Sending a message in Objective-C is translated into a call of the function `objc_msgSend(receiver, selector, arguments)` or one of its variants `objc_msgSendSuper`, `objc_msgSend_stret`, `objc_msgSendSuper_stret`.

If it was possible to change the implementation of these functions, we could intercept any message. Unfortunately, `objc_msgSend` is part of the Objective-C runtime and cannot be overridden.

By googling I found a paper on Google Books: [A Reflective Architecture for Process Control Applications by Charlotte Pii Lunau](http://books.google.com/books?id=xEdJoKgPHOYC&pg=PA188&lpg=PA188&dq=intercepting+objc_msgsend&source=bl&ots=tc5lMYXHzj&sig=bDLqrSFArDqOEsistOHCS62hVzE&hl=de&ei=-ALnSozvMceG_Abn39SCCA&sa=X&oi=book_result&ct=result&resnum=1&ved=0CAgQ6AEwAA#v=onepage&q=&f=false). The paper introduces a hack by redirecting an object's `isa` class pointer to an instance of a custom MetaObject class. Messages that were intended for the modified object are thus sent to the MetaObject instance. Since the MetaObject class has no methods of its own, it can then respond to the forward invocation by forwarding the message to the modified object.

The paper does not include the interesting bits of the source code and I have no idea if such an approach would have side effects in Cocoa. But it might be interesting to try.
To do something when a method is called, you could try an events based approach. So when the method is called, it broadcasts an event, which is picked up by any listeners. I'm not great with objective C, but I just figured out something similar using [NSNotificationCenter](http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/Reference/Reference.html) in Cocoa. 

But if by "intercept" you mean "stop", then maybe you need more logic to decide wether the method should be called at all.