无标题文章

代码样式
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() {

}

你可能感兴趣的:(无标题文章)