iOS Twitter api删除收藏夹时出现错误代码:34
我有一个应用程序,可以让你查看你喜欢的推文,如果你不再需要它,它还可以让你从收藏夹中删除它们 我一辈子也弄不明白我为什么会犯这样的错误:iOS Twitter api删除收藏夹时出现错误代码:34,twitter,error-handling,ios7,slrequest,Twitter,Error Handling,Ios7,Slrequest,我有一个应用程序,可以让你查看你喜欢的推文,如果你不再需要它,它还可以让你从收藏夹中删除它们 我一辈子也弄不明白我为什么会犯这样的错误: 2013-10-13 17:33:57.306 MyApp[6233:a0b] { errors = ( { code = 34; message = "Sorry, that page does not exist"; } ); } 以下
2013-10-13 17:33:57.306 MyApp[6233:a0b] {
errors = (
{
code = 34;
message = "Sorry, that page does not exist";
}
);
}
以下是调用请求的代码:
#define TW_API_DESTROY_FAVORITE @"https://api.twitter.com/1.1/favorites/destroy.json"
- (void)deleteFavoriteWithID:(NSString *)tweetID atIndex:(int) index {
NSURL *theURL = [NSURL URLWithString:TW_API_DESTROY_FAVORITE];
// Get AppDelegate reference
AppDelegate *appDelegate =[[UIApplication sharedApplication] delegate];
NSMutableDictionary *favoriteParameters = [[NSMutableDictionary alloc] init];
[favoriteParameters setObject:tweetID forKey:@"id"];
// Create TWRequest, with parameters, URL & specify GET method
SLRequest *twitterFeed = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodPOST URL:theURL parameters:favoriteParameters];
// Specify twitter request's account to our app delegate's
twitterFeed.account = appDelegate.userAccount;
// Making the request
[twitterFeed performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
// Check if we reached the reate limit
if ([urlResponse statusCode] == 429) {
NSLog(@"Rate limit reached");
return;
}
// Check if there was an error
if (error) {
NSLog(@"Error: %@", error.localizedDescription);
return;
}
// Check if there is some response data
if (responseData) {
NSError *jsonError = nil;
id feedData = [NSJSONSerialization JSONObjectWithData:responseData options:0 error:&jsonError];
if (!jsonError) {
NSLog(@"%@", feedData);
} else {
// Alert the user of an error
});
}
}
});
}];
}
不管出于什么原因,它只是不接受这一点。在应用程序的其他地方,我使用了完全相同的代码,它工作得很好,但无论出于什么原因,它都不会正常启动
有什么想法吗?谢谢