GithubHelp home page GithubHelp logo

macrong / dumbpatch Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 211 KB

iOS crash 脑残补丁 (只需要加入项目中 降低iOS崩溃率) objc error Unrecognized selector sent to instance

License: MIT License

Ruby 0.38% Objective-C 95.14% C 0.08% Shell 4.40%

dumbpatch's Introduction

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, [email protected]

License

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

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.