视奸一个类的ivar改变(配合BigBang/ANYMethodLog口味更佳)


#1

先扔链接,,,Monitoring Ivar Changes in Objective-C

BigBang/ANYMethodLog不能监视直接的ivar访问,于是写了个视奸ivar的东西

@interface ProtectedClass : NSObject {
@public
        NSString * _password;
}
@property (nonatomic, getter=password, setter=setPassword:) NSString * password;
@end
/// ...omited...
    ProtectedClass * obj = [[ProtectedClass alloc] init];
    obj->_password = @"喵咕咪~"; // directly access, undectectable in BigBang or ANYMethodLog
    [obj setPassword:@"喵"]; // BigBang or ANYMethodLog dectectable
/// ...omited...

使用效果如下

GitHub: BlueCocoa/Meow