2009-04-15 46 views

回答

5

附近的方法,頂部NSParameterAssert必要的對象不是nil,指數在範圍內,等等。有時候,你可以得到這些免費的;例如,由數組支持的索引訪問器可以讓底層數組爲其進行斷言。

2
NSAssert(thisShouldBeTrue, @"Error message");