05 January 2011 by Published in: Code, iphone, rants 1 comment

Experts-Exchange was bad.  Really, really bad.  StackOverflow is much better.  But.  That’s not saying much.  It’s still pretty bad.  I try to avoid it when I can.

However, I recently got stuck–something weird was going on with Blocks and memory management.  So I posted this question.  It’s quite a detailed question.  The question itself is sort of unimportant to my point, so I will summarize it:

  • I am experiencing a crash
  • The crash is memory-related, and I am debugging it by peering into the internals of the Objective-C memory manager
  • I have whittled it down to a very small test case sprinkled with memory-management-debug-code that is of course not production-ready that indicates the problem clearly and repeatedly
  • The behavior I am observing seems to run against what the documentation says should happen

Here is a summary of the response I received (4 votes):

  • “The absolute retainCount… is meaningless” (which has nothing to do with what I am doing, I am comparing retainCount deltas).  This sentence was taken from another answer where it was in fact helpful, but it was applied incorrectly here.
  • A one-sentence woefully inadequate summary of the memory management rules, which (hopefully) I already know.  If I didn’t, I certainly would not have been enlightened about them by reading that sentence.
  • “Are you actually observing a crash? Or are you just shooting blindly from the hip and thinking that it might crash?”
  • [Actual answer to the question]
  • Admonition to never look inside the memory management internals, presumably because I cannot possibly understand the magic of autorelease pools or deferred execution, topics which I am not in the least bit confused about, and even if I was, could be easily explained by pointing to the relevant documentation
  • An “application” of the memory management rules that sounds correct at first reading but is in fact dangerously wrong
  • A “correction” to the application by a commenter who “improves” it but still leaves the statement dangerously incorrect.

Perhaps 10% of the answer was actually on-topic to the question.  I have to extract this relevant information from a minefield of condescending or (worse) misleading information.

I don’t mean to attack the answerer.  By all accounts he is a really nice guy and even authoritative in the field!  But whenever I ask questions on SO, I seem to get answers like this.

Want me to build your app / consult for your company / speak at your event? Good news! I'm an iOS developer for hire.

Like this post? Contribute to the coffee fund so I can write more like it.


  1. Bog U. Samfool
    Mon 17th Jan 2011 at 12:23 pm

    You know when you have malloc’ed memory you should free it exactly once, or the Java Ruby compiler will crash its global interpreter reentry lock library class. So it’s no wonder this appears to make your OS X Ubutu crash.

    Sorry, I just could hardly resist continuing the running joke of continuing the stupidly irrelevant responses.

Add comment

Copyright © 2011 Drew Crawford, All Rights Reserved
Powered by WordPress

Page optimized by WP Minify WordPress Plugin