Sto lavorando su un'applicazione in Xcode 6.1, iOS 8.1; l'applicazione stava funzionando perfettamente fino a 2 giorni prima, ma oggi come ho eseguito ho ricevuto un errore nel servizio web & l'errore è stampato qui sotto.Errore: dominio errore = NSURLErrorDomain Code = -1001 "La richiesta è scaduta."
Error: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x7c6899b0 {NSErrorFailingURLStringKey=, NSErrorFailingURLKey=, NSLocalizedDescription=The request timed out., NSUnderlyingError=0x7c688f60 "The request timed out."}
avevo usato AFNetworking 2.xe seguente frammento di codice per effettuare chiamate di rete:
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.requestSerializer = [AFJSONRequestSerializer serializer];
manager.responseSerializer = [AFJSONResponseSerializer serializer];
manager.responseSerializer.acceptableContentTypes=[manager.responseSerializer.acceptableContentTypes setByAddingObject:@"text/html"];
[manager POST:<URL>
parameters:<parameters>
success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"JSON: %@", responseObject);
NSError *error = nil;
NSDictionary *JSON = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:&error];
if (error) {
NSLog(@"Error serializing %@", error);
}
NSLog(@"Dictionary %@", JSON);
NSLog(@"Success");
}
failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
}
UPDATE: avevo fatto smettere/rilanciato l'iOS Simulator.app, contenuti reseted & impostazioni , ma niente ha funzionato.
Ho controllato, la mia configurazione di rete non sta cambiando è uguale in tutto il processo. Avevo fatto tutto ciò che sapevo, ho smesso/riavviato iOS Simulator.app, ripristinato i contenuti e le impostazioni ... ma niente funzionava. – iYoung