Apple’s sense of humor

I had a good laugh today when I got a nice error from XCode.

I made a mistake and passed the wrong variable to NSMutableArray::initWithCapacity.The value of the variable was -1 which, obviously, got cast to an unsigned and caused a crash. But I found the error message funny.

Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘*** -[__NSPlaceholderArray initWithCapacity:]: capacity (4294967295) is ridiculous’

Thanks XCode team, you made my day brighter!

One comment

  1. 我就是随便看看

Leave a comment