NSException *ex = [NSException exceptionWithName:@"先看看宽高是否相等" reason:@"宽高不相等" userInfo:nil]; [ex raise];
或者
[NSException raise:@"先看看宽高是否相等" format:@"宽高不相等"];
效果如下:
转载于:https://my.oschina.net/gwlCode/blog/839277