Creating Retain Cycles by Misusing Assertions
Evadne Wu (via Kevin Ballard):
When you use
NSAssert, ultimately the expanded code contains a reference toselfand_cmd, inside whatever method the line was used. This also prohibits use ofNSAssertin a block, because it creates a retain cycle. Just useNSCAssertwhich looks slightly wonky but does not require being used within an Objective-C method, and does not allow the programmer to accidentally create retain cycles.