AFHTTPRequestOperationManagerにはタイムアウトとキャッシュポリシーを設定するプロパティが無いので
カテゴリクラスを作っておくと便利です。
AFHTTPRequestOperationManagerのカテゴリメソッド
- (AFHTTPRequestOperation *)GET:(NSString *)URLString
parameters:(NSDictionary *)parameters
timeoutInterval:(NSTimeInterval)timeoutInterval
cachePolicy:(NSURLRequestCachePolicy)cachePolicy
success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
{
NSError* error = nil;
NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:@"GET"
URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString]
parameters:parameters
error:&error];
[request setTimeoutInterval:timeoutInterval];
[request setCachePolicy:cachePolicy];
AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithRequest:request success:success failure:failure];
[self.operationQueue addOperation:operation];
return operation;
}