ios - 关于AFN中AFNetworkActivityIndicatorManager KVO的疑问?
ringa_lee
ringa_lee 2017-04-18 09:46:42
0
1
428
- (void)setNetworkActivityIndicatorVisible:(BOOL)networkActivityIndicatorVisible {
    if (_networkActivityIndicatorVisible != networkActivityIndicatorVisible) {
        [self willChangeValueForKey:@"networkActivityIndicatorVisible"];
        @synchronized(self) {
             _networkActivityIndicatorVisible = networkActivityIndicatorVisible;
        }
        [self didChangeValueForKey:@"networkActivityIndicatorVisible"];
        if (self.networkActivityActionBlock) {
            self.networkActivityActionBlock(networkActivityIndicatorVisible);
        } else {
            [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:networkActivityIndicatorVisible];
        }
    }
}

1、set方法中手动触发了KVO,这里不就触发了两次KVO回调吗?
2、为什么触发了,却不做响应呢?

ringa_lee
ringa_lee

ringa_lee

reply all(1)
刘奇
(readonly, nonatomic, assign, getter=isNetworkActivityIndicatorVisible)

How did you trigger this? It should be impossible to respond

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template