I'm having trouble sending a response to a tweet using the TWRequest
api. I can post a new tweet / status successfully, but the answers are with an error below. Please inform
I get an error message:
Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn't be completed. (NSURLErrorDomain error -1012.)" UserInfo=0x6c67900 {NSErrorFailingURLKey=https:
Sample code below:
NSDictionary *paramDict = nil; if(isReply) { paramDict = [NSDictionary dictionaryWithObjectsAndKeys: in_reply_to_status_id, @"in_reply_to_status_id", status, @"status", nil]; NSLog(@"Status is %@ %@",status,in_reply_to_status_id); } else { paramDict = [NSDictionary dictionaryWithObject:status forKey:@"status"]; } TWRequest *sendTweet = [[TWRequest alloc] initWithURL:[NSURL URLWithString:@"https://api.twitter.com/1/statuses/update.json"] parameters:paramDict requestMethod:TWRequestMethodPOST]; sendTweet.account = self.account; [sendTweet performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) { if ([urlResponse statusCode] == 200) { dispatch_sync(dispatch_get_main_queue(), ^{ NSLog(@"Sent tweet: %@", status); }); } else { NSLog(@"Problem sending tweet: %@", error); } }];
source share