我在发布对特定状态ID的回复时遇到问题

这是我的验证码

twitterWithReply = [STTwitterAPI twitterAPIOSWithFirstAccount];

[twitterWithReply verifyCredentialsWithSuccessBlock:^(NSString *username) {

       NSLog(@"Login Successful");
       self.replyTextField.enabled = YES;

}


errorBlock:^(NSError *error){

       UIAlertView *alertView = [[UIAlertView alloc]
                                  initWithTitle:@"Sorry"
                                  message:@"You can't send a tweet right now, make sure your device has an internet connection and you have at least one Twitter account setup"
                                  delegate:self
                                  cancelButtonTitle:@"OK"
                                  otherButtonTitles:nil];
       [alertView show];
    }];

这是我发布回复的代码

NSLog(@"the text content%@",self.replyTextField.text);
    [self.replyTextField resignFirstResponder];
    if (self.replyTextField.text.length>0 && self.replyTextField.text.length <=140) {
        // Post reply
        [twitterWithReply postStatusUpdate:self.replyTextField.text inReplyToStatusID:self.tweeetID latitude:nil longitude:nil placeID:nil displayCoordinates:nil trimUser:nil successBlock:^(NSDictionary *status) {
            [self showSuccessDialog];
        } errorBlock:^(NSError *error) {
            NSLog(@"%@",[error localizedDescription]);
        }];

    }

目前,它的工作是发布到我自己的时间轴上,而不是回复特定的tweet。 我觉得我的验证码是错误的。 那我该如何认证呢?

===============>>#1 票数:1

我只是使用STTwitter的开发版本检查了此方案,它可以按预期工作。

如果此代码对您不起作用,请用尽可能多的详细信息填写问题

self.twitter = [STTwitterAPI twitterAPIOSWithFirstAccount];

[_twitter verifyCredentialsWithSuccessBlock:^(NSString *username) {

    [_twitter postStatusUpdate:@"test1" inReplyToStatusID:nil latitude:nil longitude:nil placeID:nil displayCoordinates:nil trimUser:nil successBlock:^(NSDictionary *status) {

        NSLog(@"-- status1: %@", status);

        [_twitter postStatusUpdate:@"test2" inReplyToStatusID:[status valueForKey:@"id_str"] latitude:nil longitude:nil placeID:nil displayCoordinates:nil trimUser:nil successBlock:^(NSDictionary *status) {
            NSLog(@"-- status2: %@", status);
        } errorBlock:^(NSError *error) {
            NSLog(@"-- error2: %@", error);
        }];

    } errorBlock:^(NSError *error) {
        NSLog(@"-- error1: %@", error);
    }];

} errorBlock:^(NSError *error) {
    NSLog(@"-- error0: %@", error);
}];

在此处输入图片说明

  ask by Romelio Tavas Jr. translate from so

未解决问题?本站智能推荐: