XUNCrashShield 0.1.0

XUNCrashShield 0.1.0

Xun 维护。



  • Xun

XUNCrashShield

CI Status Version License Platform

示例

要运行示例项目,请首先克隆仓库,并在 Example 目录中运行 pod install

需求

安装

XUNCrashShield 可通过 CocoaPods 获得。要安装它,请简单地在您的 Podfile 中添加以下行

pod 'XUNCrashShield'

作者

Xun, [email protected]

许可

XUNCrashShield 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。

介绍

访问 NSArray 时越界?

向 NSMutableArray、NSMutableDictionary 中插入空值?

利用空值初始化 NSArray、NSDictionary、NSSet ?

将 UIView、CALayer 添加为 subview、sublayer ?

消息转发时找不到对应方法?

使用 KVC 时 key 为 nil 或者 undefined?

......

还在为这些常见的线上崩溃而头疼吗?

现在你们不用担心了,XUNCrashShield 能够帮助你解决 80% 以上的崩溃。

此外,对象使用 KVO 或 notifications 监听消息时,忘记在 dealloc 时移除的问题也在解决中...

指南

XUNCrashShieldManager *csManager = [XUNCrashShieldManager shareManager];
csManager.excludeList = @[NSObject.class];
[csManager guard];

NSString *strings[5] = {@"1", @"2", @"3", @"4", @"5"};
strings[2] = nil;
    
//    @[strings[1], strings[2]];
//    @[strings[2]];
//    @{strings[1]:strings[2]}
    
//    [NSArray arrayWithObjects:strings count:5];
    
//    NSMutableArray *arr = @[].mutableCopy;
//    [arr insertObject:strings[0] atIndex:2];
//    [arr insertObject:strings[2] atIndex:0];
//    [arr addObject:strings[2]];
//    [arr removeObjectAtIndex:1];
//    [arr removeObjectsInRange:NSMakeRange(0, 100)];
    
//    NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:strings[1], strings[2], nil];
    
//    NSMutableDictionary *dict = @{}.mutableCopy;
//    [dict setObject:strings[1] forKey:strings[2]];

//    [self performSelector:@selector(sayHello)];
//    [self setValue:strings[2] forKey:strings[2]];
//    [self valueForKey:strings[2]];
//    [self setValue:strings[1] forKey:strings[1]];