Skip to content

快速降低iOS崩溃率 (只需要加入项目中) objc error Unrecognized selector sent to instance

License

Notifications You must be signed in to change notification settings

zhangkedyq/DumbPatch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DumbPatch

CI Status Version License Platform

快速降低iOS崩溃率 (只需要加入项目中)

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

  • Array (__NSArrayM, __NSArray0, __NSArrayI, Unrecognized selector sent to instance):
NSArray *arr = @[];
NSMutableArray *mArr = @[].mutableCopy;
Unrecognized selector sent to instance ✅

*** Terminating app due to uncaught exception 'NSRangeException',
 reason: '*** -[__NSArrayM objectAtIndex:]: index 6 beyond bounds for empty NSArray
id obj = arr[6];  ✅
id objc = [arr objectAtIndex:6]; ✅

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
[mArr addObject:nil]; ✅

Terminating app due to uncaught exception 'NSRangeException',reason: '*** -[__NSArrayM removeObjectAtIndex:]: index 6  beyond bounds for empty
[mArr removeObjectAtIndex:6]; ✅
 
 *** Terminating app due to uncaught exception 'NSInvalidArgumentException',reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
[mArr insertObject:nil atIndex:6]; ✅

Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM replaceObjectAtIndex:withObject:]: index 6 beyond bounds for empty
[mArr replaceObjectAtIndex:6 withObject:@"obj"]; ✅

*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'example:NSString *k = nil;  [NSArray arrayWithObject:k]
NSString *k = nil; 
[NSArray arrayWithObject:k] ✅

*** -attempt to insert nil object from objects[0]
NSArray *ar = [NSArray arrayWithObjects:@"1",,@"2", nil]; ✅

Requirements

Installation

DumbPatch is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'DumbPatch'

Author

macRong, rong@shengshui.com

License

DumbPatch is available under the MIT license. See the LICENSE file for more info.

About

快速降低iOS崩溃率 (只需要加入项目中) objc error Unrecognized selector sent to instance

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 95.1%
  • Shell 4.4%
  • Other 0.5%