Come faccio a tirare dentro gli errori quando si tenta di tweet da un app iOS utilizzando l'API di Twitter + OAuth?
-
25-09-2019 - |
Domanda
Come faccio a impostare correttamente il metodo di callback per un aggiornamento di stato utilizzando l'API di Twitter + OAuth? (Http://github.com/bengottlieb/Twitter-OAuth-iPhone)
In questo momento sto utilizzando la seguente per determinare se una richiesta riuscita:
- (void)requestSucceeded:(NSString *)connectionIdentifier {
NSLog(@"Statuses Sent");
//[loadingActionSheet dismissWithClickedButtonIndex:0 animated:YES];
//[loadingActionSheet release];
}
Che cosa avrei utilizzare per determinare se una richiesta non è riuscita?
Soluzione
Leggere documenti aiuta, implementato quanto segue per risolvere il mio problema:
- (void) requestFailed:(NSString *)connectionIdentifier withError: (NSError *) error; {
NSLog(@"Status Update Failed");
NSLog(@"Error: %@", error);
[loadingActionSheet dismissWithClickedButtonIndex:0 animated:YES];
[loadingActionSheet release];
alert = [[UIAlertView alloc]
initWithTitle:@"Error" message:@"Twitter did not receive your update, please try again later." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow