NSString+category `isEqual` crash

@interface NSString (EqualTest)

@end

@implementation NSString (EqualTest)
- (BOOL)isEqual:(id)object {
    NSLog(@"%s", __FUNCTION__);
    return [super isEqual:object];
}
@end

会导致程序崩溃,why ???

添加 Log NSLog(@"self %@ obj %@", self,object);获取输出结果

2019-05-10 22:14:01.840434+0800 CrashTest[5755:258494] self /Users/yupeiliang/Library/Developer/CoreSimulator/Devices/C826761C-8E46-40E3-9C19-1A27F0C99338/data/Containers/Bundle/Application/032790F2-C75C-4983-A460-047DC92F9E50/CrashTest.app obj
2019-05-10 22:14:01.854825+0800 CrashTest[5755:258494] self /Users/yupeiliang/Library/Developer/CoreSimulator/Devices/C826761C-8E46-40E3-9C19-1A27F0C99338/data/Containers/Bundle/Application/032790F2-C75C-4983-A460-047DC92F9E50/CrashTest.app obj
2019-05-10 22:14:01.855035+0800 CrashTest[5755:258494] self /Users/yupeiliang/Library/Developer/CoreSimulator/Devices/C826761C-8E46-40E3-9C19-1A27F0C99338/data/Containers/Bundle/Application/032790F2-C75C-4983-A460-047DC92F9E50/CrashTest.app obj
2019-05-10 22:14:01.866414+0800 CrashTest[5755:258404] self /Users/yupeiliang/Library/Developer/CoreSimulator/Devices/C826761C-8E46-40E3-9C19-1A27F0C99338/data/Containers/Bundle/Application/032790F2-C75C-4983-A460-047DC92F9E50/CrashTest.app obj
2019-05-10 22:14:01.875905+0800 CrashTest[5755:258404] libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform.
2019-05-10 22:14:01.906212+0800 CrashTest[5755:258404] self /Users/yupeiliang/Library/Developer/CoreSimulator/Devices/C826761C-8E46-40E3-9C19-1A27F0C99338/data/Library/Caches/com.apple.UIStatusBar/16B91 obj
2019-05-10 22:14:01.906824+0800 CrashTest[5755:258404] self /Users/yupeiliang/Library/Developer/CoreSimulator/Devices/C826761C-8E46-40E3-9C19-1A27F0C99338/data/Library/Caches/com.apple.UIStatusBar/16B91/images/1372315416085228149913339104416518237819 obj
2019-05-10 22:14:01.908193+0800 CrashTest[5755:258404] self /Users/yupeiliang/Library/Developer/CoreSimulator/Devices/C826761C-8E46-40E3-9C19-1A27F0C99338/data/Library/Caches/com.apple.UIStatusBar/16B91/images/91349195663463469177238126024527451290 obj
2019-05-10 22:14:01.908935+0800 CrashTest[5755:258404] self /Users/yupeiliang/Library/Developer/CoreSimulator/Devices/C826761C-8E46-40E3-9C19-1A27F0C99338/data/Library/Caches/com.apple.UIStatusBar/16B91/images/91349195663463469179510860190675676465 obj
2019-05-10 22:14:01.910065+0800 CrashTest[5755:258404] self /Users/yupeiliang/Library/Developer/CoreSimulator/Devices/C826761C-8E46-40E3-9C19-1A27F0C99338/data/Library/Caches/com.apple.UIStatusBar/16B91/images/91349195663463469177596626995019811720 obj

你可能感兴趣的:(NSString+category `isEqual` crash)