【问题标题】:How do I Pull in errors when attempting to tweet from an iOS app using the Twitter+OAuth API?尝试使用 Twitter+OAuth API 从 iOS 应用程序发送推文时如何拉入错误?
【发布时间】:2011-01-04 21:05:15
【问题描述】:
如何使用 Twitter+OAuth API 正确设置状态更新的回调方法? (http://github.com/bengottlieb/Twitter-OAuth-iPhone)
现在我正在使用以下方法来确定请求是否成功:
- (void)requestSucceeded:(NSString *)connectionIdentifier {
NSLog(@"Statuses Sent");
//[loadingActionSheet dismissWithClickedButtonIndex:0 animated:YES];
//[loadingActionSheet release];
}
我将使用什么来确定请求是否失败?
【问题讨论】:
标签:
callback
ios4
twitter
mgtwitterengine
twitter-oauth
【解决方案1】:
阅读文档有帮助,实现了以下解决我的问题:
- (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];
}