美文网首页
无标题文章

无标题文章

作者: coder_hong | 来源:发表于2016-11-23 16:20 被阅读5次
    代码样式
    static NSArray * AFHTTPRequestSerializerObservedKeyPaths() {
        static NSArray *_AFHTTPRequestSerializerObservedKeyPaths = nil;
        static dispatch_once_t onceToken;
        dispatch_once(&onceToken, ^{
            _AFHTTPRequestSerializerObservedKeyPaths = @[NSStringFromSelector(@selector(allowsCellularAccess)), NSStringFromSelector(@selector(cachePolicy)), NSStringFromSelector(@selector(HTTPShouldHandleCookies)), NSStringFromSelector(@selector(HTTPShouldUsePipelining)), NSStringFromSelector(@selector(networkServiceType)), NSStringFromSelector(@selector(timeoutInterval))];
    
        });
        
        return _AFHTTPRequestSerializerObservedKeyPaths;
    }
    
    使用
    NSLog(@"%@", AFHTTPRequestSerializerObservedKeyPaths());
    
    当执行`AFHTTPRequestSerializerObservedKeyPaths()`会调用,没调用一次就执行{}
    NSArray * AFHTTPRequestSerializerObservedKeyPaths() {
    
    }
    

    相关文章

      网友评论

          本文标题:无标题文章

          本文链接:https://www.haomeiwen.com/subject/mrlvpttx.html