Git Product home page Git Product logo

jjexception's People

Contributors

jezzmemo avatar kealdishx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jjexception's Issues

关于KVO异常的处理

Describe the bug
我的项目中使用了最新的afnetworking框架3.2.1。pod引入JJException后,按照文档设置好,使用了JJExceptionGuardAll,这个时候运行app大概率会crash,提示afn相关的"KVO removeObserver did not exist key:%@ observer:%@"异常提示并crash。
然后修改配置,去掉KVO相关异常的guard,再运行app就正常了

Please complete the following information

  • Device: [模拟器 iPhone6s]
  • OS: [ iOS12]

请问下,我需要全局将崩溃日志上传到bugly上去,怎么只写一个回传方法,而不是每一个控制器里实现协议

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

KVOCrash与AFN搭配会有概率闪退

Describe the bug
在didFinishLaunchingWithOptions启动startGuardException(含有JJExceptionGuardKVOCrash)与发起网络请求,有一定概率在AFURLSessionManager 142行
progress.totalUnitCount = NSURLSessionTransferSizeUnknown; 崩溃(Thread 1: EXC_BAD_ACCESS)
configExceptionCategory 不含 JJExceptionGuardKVOCrash 则正常
具体闪退规律暂没有找到
Please complete the following information

  • Device: [e.g. iPhoneSE]
  • OS: [e.g. iOS12.0.1]

cocoaPods导入报错

xcode版本:xcode 10.0

Podfile文件内容如下:
platform:ios, '9.0'

target 'TestJJException' do
pod 'JJException'
end

终端安装报错: [!] Unable to find a specification for JJException
尝试pod search JJException
结果报错:[!] Unable to find a pod with name, author, summary, or description matching JJException

pod search AFNetworking 等其他第三方库正常

COCOAPODS 不是最新版本?头文件都没有startGuardException方法

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

弹出收起键盘的时候还是会有异常报错哦

步骤:

1、[self.textField becomeFirstResponder];// 打开键盘 (无报错)

2、[[[UIApplication sharedApplication] keyWindow] endEditing:YES];  // 关闭键盘 (报错啦!)

环境:
MAC:10.13.6 (17G65)
Version 10.1 (10B61)
Model: iPhone X (Model A1865, A1901, A1902, A1903)

报错信息:

KVO forgot remove keyPath:center from which object:NSKVONotifying_UIInputSetHostView
(
0   xxx 0x00000001049f989c -[JJExceptionProxy handleCrashException:exceptionCategory:extraInfo:] + 144,
1   xxx 0x00000001049f9418 _Z20handleCrashException24JJExceptionGuardCategoryP8NSString + 120,
2   xxx 0x00000001049ff108 -[KVOObjectContainer clearKVOData] + 396,
3   xxx 0x00000001049feee0 -[KVOObjectContainer dealloc] + 40,
4   libobjc.A.dylib 0x0000000222d7a13c <redacted> + 468,
5   libobjc.A.dylib 0x0000000222d74728 objc_destructInstance + 96,
6   libobjc.A.dylib 0x0000000222d74774 object_dispose + 16,
7   xxx 0x0000000104a00824 -[NSObject(ZombieHook) hookDealloc] + 136,

RAC

这个库跟RAC是否能兼容呢

所以在没找到更好的办法,只能Swizzle dealloc方法,先清理kvo数据,再执行origin dealloc,不过这样就有个细节做不到,无法提示那些keyPath忘记清理

这不是一个bug 上面内容为你说明的原话,其实你说的“无法提示那些keyPath忘记清理”是可以在相关函数中提示的
1、清除不存在的key也会闪退:hookRemoveObserver里面checkKVOItemExist里面没有else
2、添加监听后没有清除会导致闪退:clearKVOData的时候其实如果正常的话 set里面应该是没有说句的 有数据说明不正常 不正常就要上报
3、添加重复的key导致闪退:hookAddObserver里面的checkKVOItemExist也是没有else

没有恶意啊 我发现 你写代码if都没有else啊 😁😁😁...

请教一个问题

你好,请教一个问题。
官方文档写到: 如果方法成功添加,则返回“是”,否则为“否”。
那么为什么会出现添加失败

 Class metaclass = objc_getMetaClass(NSStringFromClass(cls).UTF8String);
class_addMethod(metaclass,
                                       originSelector,
                                       method_getImplementation(swizzleSelector),
                                       method_getTypeEncoding(swizzleSelector));

pod 只能导入0.1.0吗?

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Please complete the following information

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Version [e.g. 22]
    image

集成在项目里之后好像和FMDB有冲突,造成了无限循环调用

主要是字符串的那几个方法:
hookStringWithUTF8String: NSString(StringHook);

hookRangeOfString:options:range:locale: NSString(StringHook);

hookSubstringFromIndex: NSMutableString(MutableStringHook)

hookSubstringToIndex: NSMutableString(MutableStringHook)

hookSubstringWithRange: NSString(StringHook)

AVFoundation使用有问题

开启JJExceptionGuardKVOCrash后,AVFoundation加载本地视频资源偶现只有声音没有视频的异常,关闭则正常,设备版本iOS11 iOS12 都可以复现,视频格式mp4,编码264,目前只有加载本地视频有这个问题。播放的逻辑是检查到AVPlayerItem.status == AVPlayerItemStatusReadyToPlay 则开始播放。

为什么不执行代理方法?

#import "WXExceptionController.h"
#import <JJException/JJException.h>

@interface WXExceptionController ()

@EnD

@implementation WXExceptionController

  • (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"异常信息";

    [JJException registerExceptionHandle:self];
    }

  • (void)handleCrashException:(NSString *)exceptionMessage exceptionCategory:(JJExceptionGuardCategory)exceptionCategory extraInfo:(NSDictionary *)info {
    WXLog(@"exceptionMessage: %@\n exceptionCategory: %@\n extraInfo: %@", exceptionMessage, @(exceptionCategory), info)
    }

-(void)handleCrashException:(NSString *)exceptionMessage extraInfo:(NSDictionary *)info {
WXLog(@"exceptionMessage: %@\n extraInfo: %@", exceptionMessage, info)
}

@EnD

当抛错误时,两个代理方法不会执行,不能记录日志

与AFN配合kvo启动闪退

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Please complete the following information

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Version [e.g. 22]

image

image

image

image

demo 闪退

Class currentClass = self.class;

//Check black list
if (![[[JJExceptionProxy shareExceptionProxy] blackClassesSet] containsObject:currentClass]) {
    [self hookDealloc];
    return;
}

点击stop guard 闪退 - (void)hookDealloc 死循环
在IOS 12 xcode 10.0

循环调用问题

(void) hookAddObject:(id)object {
if (object) {
[self hookAddObject:object];
} else {
handleCrashException(JJExceptionGuardArrayContainer,@"NSSet addObject nil object");
}
}这个方法会造成循环调用吗?

存在内存泄漏问题

Describe the bug
在didFinishLaunchingWithOptions启动startGuardException,包含JJExceptionGuardKVOCrash,在运行到AFURLSessionManagerTaskDelegate中的方法- (instancetype)initWithTask:中的162行:

[progress addObserver:self forKeyPath:NSStringFromSelector(@selector(fractionCompleted))
options:NSKeyValueObservingOptionNew
context:NULL]

时会存在内存泄漏:

0 Malloc +1 1 -[NSPlaceholderString initWithBytes:length:encoding:]
1 Autorelease NSStringFromSelector
2 Retain +1 2 +[NSString(StringHook) hookStringWithUTF8String:]
3 Autorelease -[AFURLSessionManagerTaskDelegate initWithTask:]
4 Retain +1 3 -[AFURLSessionManagerTaskDelegate initWithTask:]
5 Retain +1 4 -[NSObject(KVOCrash) hookAddObserver:forKeyPath:options:context:]
6 Release -1 3 -[AFURLSessionManagerTaskDelegate initWithTask:]
7 Release -1 2 CA::Context::commit_transaction(CA::Transaction*)
8 Release -1 1 CA::Context::commit_transaction(CA::Transaction*)

当不含JJExceptionGuardKVOCrash时,不会存在这个问题。
JJException和AFNetWorking都是最新版本

Please complete the following information

  • Device: iPhone6s
  • OS: iOS9.2

开启JJ 调用摄像头后闪退

Describe the bug
开启JJExceptionGuardKVOCrash防护 调用摄像头会闪退
在#import "NSObject+KVOCrash.m"中cleanObservers里面会闪退

  • (void)cleanObservers{
    for (KVOObjectItem* item in self.observers) {
    [self.whichObject removeObserver:item.observer forKeyPath:item.keyPath];
    }
    }

打印出 item.observer 是
<AVCaptureSession: 0x28090cee0 [AVCaptureSessionPresetPhoto]>
<AVCaptureDeviceInput: 0x280b865e0 [后置双镜头]> -> (null)
<AVCaptureDeviceInput: 0x280b865e0 [后置双镜头]> -> <AVCapturePhotoOutput: 0x280b945e0>
<AVCaptureDeviceInput: 0x280b865e0 [后置双镜头]> -> <AVCaptureMetadataOutput: 0x280bb6d00>

所有苹果手机型号和系统都会闪退

老哥出大事了,handleCrashException里面的回调info是空的

以下是 exceptionMessager 内容, 而info是空的;

lldb) po exceptionMessage 4402061312 107094016 NSArray objectAtIndexedSubscript invalid index:1 total:0 ( 0 xxx 0x0000000106a30626 -[JJExceptionProxy handleCrashException:exceptionCategory:extraInfo:] + 134, 1 xxx 0x0000000106a30200 _Z20handleCrashException24JJExceptionGuardCategoryP8NSString + 96, 2 xxx 0x0000000106a31b55 -[NSArray(ArrayHook) hookObjectAtIndexedSubscript:] + 197, 3 xxx 0x00000001067777b5 -[TSLStationFilterViewController initialize] + 213, 4 xxx 0x00000001067776da -[TSLStationFilterViewController viewDidLoad] + 74, 5 UIKitCore 0x00000001170b44e1 -[UIViewController loadViewIfRequired] + 1186, 6 UIKitCore 0x00000001170b4940 -[UIViewController view] + 27, 7 UIKitCore 0x0000000116ffea9b -[UINavigationController _startCustomTransition:] + 931, 8 UIKitCore 0x00000001170153f0 -[UINavigationController _startDeferredTransitionIfNeeded:] + 741, 9 UIKitCore 0x00000001170167e0 -[UINavigationController __viewWillLayoutSubviews] + 150, 10 UIKitCore 0x0000000116ff6600 -[UILayoutContainerView layoutSubviews] + 217, 11 UIKit 0x000000012c09a6c4 -[UILayoutContainerViewAccessibility layoutSubviews] + 42, 12 UIKitCore 0x0000000117bbd795 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1441, 13 QuartzCore 0x000000010c896b19 -[CALayer layoutSublayers] + 175, 14 QuartzCore 0x000000010c89b9d3 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 395, 15 QuartzCore 0x000000010c8147ca _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 342, 16 QuartzCore 0x000000010c84b97e _ZN2CA11Transaction6commitEv + 576, 17 UIKitCore 0x00000001176cd701 _UIApplicationFlushRunLoopCATransactionIfTooLate + 165, 18 UIKitCore 0x00000001177c7569 __handleEventQueueInternal + 6874, 19 CoreFoundation 0x00000001096ad721 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17, 20 CoreFoundation 0x00000001096acf93 __CFRunLoopDoSources0 + 243, 21 CoreFoundation 0x00000001096a763f __CFRunLoopRun + 1263, 22 CoreFoundation 0x00000001096a6e11 CFRunLoopRunSpecific + 625, 23 GraphicsServices 0x0000000113ca11dd GSEventRunModal + 62, 24 UIKitCore 0x00000001176d381d UIApplicationMain + 140, 25 TeslaMap 0x000000010663c5a0 main + 112, 26 libdyld.dylib 0x000000010fba2575 start + 1, 27 ??? 0x0000000000000001 0x0 + 1, )

你好,kvo拦截时出现一个问题

  • (void)clearKVOData{
    for (KVOObjectItem* item in self.kvoObjectSet) {
    //Invoke the origin removeObserver,do not check array
    handleCrashException(YJExceptionGuardKVOCrash,[NSString stringWithFormat:@"KVO forgot remove keyPath:%@ from which object:%@",item.keyPath,NSStringFromClass(object_getClass(self.whichObject))]);
    #pragma clang diagnostic push
    #pragma clang diagnostic ignored "-Wundeclared-selector"
    @Try {
    ((void()(id,SEL,id,NSString))objc_msgSend)(self.whichObject,@selector(hookRemoveObserver:forKeyPath:),item.observer,item.keyPath);
    }@catch (NSException *exception) {
    handleCrashException(YJExceptionGuardKVOCrash,[exception reason]);
    }
    #pragma clang diagnostic pop
    }
    }

image

会在object_getClass(self.whichObject) 崩溃,麻烦看下

kvo crash

// 使用参数NSKeyValueObservingOptionInitial就会崩溃
// 仅使用NSKeyValueObservingOptionNew|NSKeyValueObservingOptionPrior|NSKeyValueObservingOptionOld这些参数不会发生崩溃

[self addObserver:self forKeyPath:@"test1" options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionInitial context:nil];

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<PushViewController 0x7ffa3fc013b0> addObserver:<PushViewController 0x7ffa3fc013b0> forKeyPath:@"test1" options:5 context:0x0] was sent to an object that is not KVC-compliant for the "test1" property.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010476429b __exceptionPreprocess + 331
1 libobjc.A.dylib 0x0000000103d00735 objc_exception_throw + 48
2 CoreFoundation 0x00000001047640f5 +[NSException raise:format:] + 197
3 Foundation 0x000000010373e7c5 -[NSObject(NSKeyValueObserverRegistration) addObserver:forKeyPath:options:context:] + 458
4 JJException 0x00000001033c359a -[NSObject(KVOCrash) hookAddObserver:forKeyPath:options:context:] + 442

与FBKVOController一起用的话有问题

总是断点在NSObject+KVOCrash.m P297行,是抓取到crash信息了吗,
[self hookRemoveObserver:observer forKeyPath:keyPath];

有时会断在方法cleanKVOData中的@Try中,不知道是否因为同FBKVOController一起使用导致的,麻烦告知一下,谢谢

KVO 这个问题一直就没有修复。。。。。

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Please complete the following information

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Version [e.g. 22]
    如果去掉JJExceptionGuardKVOCrash 就万事大吉,加上就经常崩溃!

NSMutableArray+MutableArrayHook的hookAddObject:问题

错误日志:

  • thread #30, queue = 'cocoa.lumberjack.ttyLogger', stop reason = EXC_BAD_ACCESS (code=2, address=0x16f9a3ff8)
    frame #0: 0x000000010179e6fc `-[NSMutableArray(self=0x00000001cc056560, _cmd="hookAddObject:", anObject=) hookAddObject:] at NSMutableArray+MutableArrayHook.m:37
    • frame #1: 0x000000010179e724 -[NSMutableArray(self=0x00000001cc056560, _cmd="hookAddObject:", anObject=0x00000001c001fe70) hookAddObject:] at NSMutableArray+MutableArrayHook.m:39 frame #2: 0x000000010179e724 -[NSMutableArray(self=0x00000001cc056560, _cmd="hookAddObject:", anObject=0x00000001c001fe70) hookAddObject:] at NSMutableArray+MutableArrayHook.m:39
      frame #3: 0x000000010179e724 `-[NSMutableArray(self=0x00000001cc056560, _cmd="hookAddObject:", anObject=0x00000001c001fe70) hookAddObject:] at NSMutableArray+MutableArrayHook.m:39

相同的调用 0x000000010179e724 `-[NSMutableArray(self=0x00000001cc056560, _cmd="hookAddObject:", anObject=0x00000001c001fe70) hookAddObject:] at NSMutableArray+MutableArrayHook.m:39 发生了上万次,产生一个内存失效的错误,麻烦看下

希望处理能加入replaceCharactersInRange越界异常的处理

NSString,NSMutableString,NSAttributedString,NSMutableAttributedString(下标越界以及参数nil异常)
缺少 NSMutableAttributedString replaceCharactersInRange 越界的拦截
也属于平常常遇到的crash
在用户快速切换语音输入根键盘输入的时候 如果执行这类替换方法会很容易崩,非常感谢

当originIMP不等于currentClassIMP时为什么return nil?

我在读你的源码,有个地方不太理解:

链接

NSObject+UnrecognizedSelectorHook.m --> methodSignatureForSelectorSwizzled --> 32行

    // If current class override methodSignatureForSelector return nil
    if (originIMP != currentClassIMP){
        return nil;
    }

这里返回nil的话,不就直接crash了吗?

kvo removeobser冲突 with ios 10.x

对于开启kvo异常处理时,对于10.x(测试系统版本10.3.3)系统版本存在自己实现kvo 到remove时,会与JJException的dealloc中clearKVOData一起导致多次remove而crash. 测试环境可以在YYText与此框架同时启用时,具有多次键盘关闭情况下复现。

上线审核

这个库会影响上线审核吗,会被苹果拒绝吗?

swift 项目启动崩溃

2018-12-03 19:48:41.599523+0800 project[3300:446877] +[NSSet jj_swizzleNSSet]: unrecognized selector sent to class 0x1d6a2d110
2018-12-03 19:48:41.599749+0800 project[3300:446877] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSSet jj_swizzleNSSet]: unrecognized selector sent to class 0x1d6a2d110'
*** First throw call stack:
(0x19ce6fef8 0x19c03da40 0x19cd8c1fc 0x19ce75810 0x19ce774bc 0x1033d15d8 0x1033d1c2c 0x10033c26c 0x100183254 0x1001833e4 0x1c9db3c68 0x1c9db53d0 0x1c9dbae1c 0x1c965bc18 0x1c96646f0 0x1c965b894 0x1c965c234 0x1c965a334 0x1c9659fe0 0x1c965f1a0 0x1c9660100 0x1c965f058 0x1c9663d9c 0x1c9db9314 0x1c99a4c34 0x19f89f890 0x19f8aa658 0x19f8a9d50 0x104ed8de4 0x104edca2c 0x19f8de640 0x19f8de2cc 0x19f8de8e8 0x19cdfe5b8 0x19cdfe538 0x19cdfde1c 0x19cdf8ce8 0x19cdf85b8 0x19f06c584 0x1c9dbcbc8 0x100184ca8 0x19c8b8b94)
libc++abi.dylib: terminating with uncaught exception of type NSException

加入JJException后开断点总是会卡在一处

NSObject+KVOCrash.m - (void)hookRemoveObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath 中的 [self hookRemoveObserver:observer forKeyPath:keyPath]; 这一行。 打开断点后老是会在这里卡住,断点继续后还是一直又回到这个地方(取消断点可以继续完成后续流程),这里没有设置断点的啊。版本是最新的

ZFPlayer使用有问题

*** Terminating app due to uncaught exception 'NSRangeException', reason: 'Cannot remove an observer <AVKVODispatcher 0x60400020a540> for the key path "currentItem" from <AVPlayer 0x6000002012c0> because it is not registered as an observer.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000111b811e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x000000011121e031 objc_exception_throw + 48
2 CoreFoundation 0x0000000111bf6975 +[NSException raise:format:] + 197
3 Foundation 0x000000010d84ce43 -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:] + 488
4 Foundation 0x000000010d84cc03 -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] + 84
5 TestDepend 0x000000010aaa60c8 -[NSObject(KVOCrash) hookRemoveObserver:forKeyPath:] + 232
6 Foundation 0x000000010d8aad36 -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:context:] + 177
7 AVFoundation 0x000000010c562659 -[AVPlayer addObserver:forKeyPath:options:context:] + 230
8 AVFoundation 0x000000010c63d743 -[AVKVODispatcher startObservingValueAtKeyPath:ofObject:options:usingBlock:] + 142
9 AVFoundation 0x000000010c63eaf9 -[AVKVODispatcher(LegacyCallbackMethod) startObservingObject:weakObserver:forKeyPath:options:context:] + 145
10 AVFoundation 0x000000010c52fa5d -[AVPlayerLayer _startObservingPlayer:] + 320
11 libdispatch.dylib 0x00000001121d57ab _dispatch_call_block_and_release + 12
12 libdispatch.dylib 0x00000001121d67ec _dispatch_client_callout + 8
13 libdispatch.dylib 0x000000011212018-10-12 18:30:38.116325+0800 TestDepend[62153:1447887] obserer:<ZFAVPlayerManager: 0x6000001d9410> keypath:loadedTimeRanges
debe5 _dispatch_queue_serial_drain + 1305
14 libdispatch.dylib 0x00000001121df4fa _dispatch_queue_invoke + 328
15 libdispatch.dylib 0x00000001121db344 _dispatch_queue_override_invoke + 726
16 libdispatch.dylib 0x00000001121e236c _dispatch_root_queue_drain + 664
17 libdispatch.dylib 0x00000001121e2076 _dispatch_worker_thread3 + 132
18 libsystem_pthread.dylib 0x0000000112701169 _pthread_wqthread + 1387
19 libsystem_pthread.dylib 0x0000000112700be9 start_wqthread + 13
)

testUndefineSelector crash

@protocol SomeProtocol<NSObject>
@optional
-(void)testUndefineSelector;
@end
@interface ViewController ()<JJExceptionHandle,SomeProtocol>
@end

[self performSelector:@selector(testUndefineSelector)];

崩溃了:

2018-09-30 16:11:02.955 JJException[22830:279892] -[ViewController testUndefineSelector]: unrecognized selector sent to instance 0x7f8aaff863c0
2018-09-30 16:11:02.961 JJException[22830:279892] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ViewController testUndefineSelector]: unrecognized selector sent to instance 0x7f8aaff863c0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010d6e7f65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010d161deb objc_exception_throw + 48
2 CoreFoundation 0x000000010d6f058d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010d63dd97 forwarding + 487
4 CoreFoundation 0x000000010d63db28 _CF_forwarding_prep_0 + 120
5 JJException 0x000000010cc42003 -[ViewController testUnrecognizedSelector] + 51
6 JJException 0x000000010cc41d7c -[ViewController testArrayDictionaryUnrecognizedSelector] + 44

jj_deallocBlock

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Please complete the following information

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Version [e.g. 22]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.