2010-09-27 56 views
0

如何正确设置使用Twitter + OAuth API进行状态更新的回调方法? (http://github.com/bengottlieb/Twitter-OAuth-iPhone)如何在尝试使用Twitter + OAuth API从iOS应用程序发布推文时出现错误?

现在,我使用以下,以确定是否请求成功:

- (void)requestSucceeded:(NSString *)connectionIdentifier { 
NSLog(@"Statuses Sent"); 
//[loadingActionSheet dismissWithClickedButtonIndex:0 animated:YES]; 
//[loadingActionSheet release]; 

}

会是什么我用来确定请求是否失败?

回答

0

阅读文档的帮助,实施了以下解决我的问题:

- (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]; 
} 
相关问题