我有一个应用程序,可以让您查看收藏的推文,如果您不再需要它,它还允许您从收藏夹中删除它们。
我不能为我的生活弄清楚为什么我会收到这个错误:
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
});
}
}
});
}];
}
无论出于何种原因,它都不接受这一点。在应用程序的其他地方,我使用完全相同的代码,它工作正常,但无论出于何种原因,这将无法正常启动。
有什么想法吗?谢谢!