hook NSArray 方法在debug模式下会崩溃, 在re

2016-07-15  本文已影响27人  西博尔

配合hook的使用

- (id)hook_objectAtIndex:(NSUInteger)index

{

    if (index < self.count) {

        return [self hook_objectAtIndex:index];

    } else {

#ifdef DEBUG

        AC_Assert(NO);

        NSAssert2(YES, @"aaaaa%d , count %d", index, 2);

#endif

        return nil;

    }

}
上一篇 下一篇

猜你喜欢

热点阅读