Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why NSAssert1, etc instead of NSAssert?

Tags:

I thought NSAssert couldn't use printf specifiers, but this:

NSAssert(0, @"%@%@", @"foo", @"bar");

works just as you'd expect:

*** Assertion failure in -[MyClass myMethod], <Path>/MyClass.m:84
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
    reason: 'foobar'

So what's the point of using NSAssert1, NSAssert2, etc when NSAssert works?

This with Xcode 4.0 and the iOS 4.3 SDK, if that matters. (If it doesn't, I'll update the tags.)