2014-03-26 71 views

回答

5

的時間出的信息是,你需要創建再喂到客戶端的NSURLRequest的一部分:

 AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:@""]]; 
    [httpClient setParameterEncoding:AFJSONParameterEncoding]; 
    [httpClient registerHTTPOperationClass:[AFJSONRequestOperation class]]; 


    NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL URLWithString:@""] cachePolicy:NSURLCacheStorageNotAllowed timeoutInterval:10]; // <- 10 is the timeout interval 

    AFHTTPRequestOperation *op = [httpClient HTTPRequestOperationWithRequest:req success:^(AFHTTPRequestOperation *operation, id responseObject) { 
     // DONE 
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 
     // FAILED 
    }]; 
+0

謝謝你,你讓我天..:) –

相關問題