mikeash.com: just this guy, you know?

Posted at 2009-08-31 16:39 | RSS feed (Full text feed) | Blog Index
Next article: Friday Q&A 2009-09-04: Intro to Grand Central Dispatch, Part II: Multi-Core Performance
Previous article: Friday Q&A 2009-08-28: Intro to Grand Central Dispatch, Part I: Basics and Dispatch Queues
Tags: interview link
Objective-C Runtime Podcast Episode at Mobile Orchard
by Mike Ash  

Last week I recorded an interview with Dan Grigsby of Mobile Orchard and today it showed up in his podcast. It's pretty much the same material as covered in my series on the Objective-C runtime but now in audio form, so if you like audio then get to the podcast here.

Did you enjoy this article? I'm selling whole books full of them! Volumes II and III are now out! They're available as ePub, PDF, print, and on iBooks and Kindle. Click here for more information.


Hi Mike, just listen the podcast and I really enjoyed how clear was your explanation of such a difficult topic. I have one question about the triple callback message dispatching in Objective-C, specifically the forwardInvocation: since the method returns void, is it possible to just do nothing and basically create the equivalent of a "/dev/null" for message dispatching? I'm asking this because I'm trying to understand if there are difference between forwardInvocation and Ruby method_missing. For instance, with method_instance nil is always returned (unless you return something else explicitly). Thank you.
If you do nothing in forwardInvocation: then control will indeed just return to the caller. I don't know about the return value they will see, though. You may need to explicitly zero out the return value in the NSInvocation before handing it back to them if you don't want them to receive garbage.

Note that you need to have an NSMethodSignature to be able to handle these things, which makes it hard to write an arbitrary message handler. If you're doing nothing then you can get away with an NSMethodSignature that doesn't match 100%, but you still need the return type to be correct for the forwarding mechanism to work properly.
I was wondering if you have a copy of this audio? I listened when the podcast first came out and was so amazed how much better I understood what was going on. I've wanted to find it again for years – and just happened upon the description today. I'm sure this is the enlightenment I remember.

But – the MP3 linked at Mobile Orchard is gone. oh no.

I'm afraid I don't have a copy. If you manage to dig one up, please let me know and I will post a link to it.

Comments RSS feed for this page

Add your thoughts, post a comment:

Spam and off-topic posts will be deleted without notice. Culprits may be publicly humiliated at my sole discretion.

The Answer to the Ultimate Question of Life, the Universe, and Everything?
Formatting: <i> <b> <blockquote> <code>.
NOTE: Due to an increase in spam, URLs are forbidden! Please provide search terms or fragment your URLs so they don't look like URLs.
Hosted at DigitalOcean.