1、NSNoFound
在NSObjCRuntime.h中,NSNoFound的定义为
#define NSIntegerMax LONG_MAX
enum{
NSNotFound = NSIntegerMax
};
NSNoFound是指NSInteger的最大值,一般理解为没找到符合要求的。
2、NSAssert
NSAssert()函数——开发ios程序时的调试函数。代码如下:
NSAssert(x!=0,@"x must not be zero");
在表达式“x!=0”不成立时,程序就会抛出异常,并显示自定义的消息"x must not be zero",并同时显示出错的文件、代码和调用函数等信息,是一个程序追踪的很好手段。假设x!=0,不满足要求就提示reason-x must not be zero