찾다

 >  Q&A  >  본문

ios - 关于AFN中AFNetworkActivityIndicatorManager KVO的疑问?

- (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_leeringa_lee2771일 전431

모든 응답(1)나는 대답할 것이다

  • 怪我咯

    怪我咯2017-04-18 09:48:42

    으아악

    어떻게 이런 일이 발생하게 되었나요? 답변을 못 드릴 것 같아요

    회신하다
    0
  • 취소회신하다