Skip to content

macRong/DumbPatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DumbPatch

CircleCI Version Platform Language apm

快速降低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 crash 脑残补丁 (只需要加入项目中 降低iOS崩溃率) objc error Unrecognized selector sent to instance

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors