when these situations occur, it can avoid crash.
- Unrecognized selector
- Set value or get value with KVC
- Add or remove elements repeatedly with KVO
- Beyond bounds or null value with NSArray & NSMutableArray
- Null value with NSDictionary & NSMutableDictionary
- Circular reference with NSTimer
Set callback when crash occurs.
YAEasyProtector *sharedProtector = YAEasyProtector.sharedProtector;
sharedProtector.crashHandler = ^(NSDictionary *userInfo) {
Class cls = userInfo[kYAEasyProtectorItemClassKey];
YACrashType type = [userInfo[kYAEasyProtectorItemTypeKey] integerValue];
NSString *selector = userInfo[kYAEasyProtectorItemSELKey];
NSString *callStack = userInfo[kYAEasyProtectorItemCallStackKey];
NSString *otherInfo = userInfo[kYAEasyProtectorItemUserInfoKey];
NSLog(@"%lu, %@, %@, %@, %@", (unsigned long)type, cls, selector, callStack, otherInfo);
};
YAScrollPlaceView is available under the MIT license. See the LICENSE file for more info.