ZPPSafeObject 1.1.0

ZPPSafeObject 1.1.0

Maintained by ZPP5060606.



  • By
  • ZPP506

ZPPSafeObject

CI Status Version License Platform

Example

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

Requirements

Installation

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

pod 'ZPPSafeObject'

App常见崩溃,方法找不到,容器越界,字典空值

  • NSObject+UnrecognizedSelector

    dubug: 方法找不到 崩溃提示 release: 进行容错处理

  • 数组下标越界

示例代码:

- (void)testArrayOutOfBounds
{
    NSArray *testArray = @[@1,@2,@3];
    
    NSNumber *num = testArray[3];
}
  • 字典构造造与修改

示例代码:

- (void)testDicSetNilValueCrash
{
    // 构造不可变字典时 key和value都不能为空
    NSString *nilValue = nil;
    NSString *nilKey = nil;
    NSDictionary *dic1 = @{@"key" : nilValue};
    NSDictionary *dic2 = @{nilKey : @"value"};
}

Author

ZPP506, [email protected]

License

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