Method Swizzling处理数组越界
2020-02-29 本文已影响0人
程序员都是傻子呀
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[objc_getClass("__NSArrayI")
swizzleMethod:@selector(objectAtIndex:)
withMethod:@selector(cf_objectAtIndex:)];
});