2011-03-19 67 views
0

是我的代码。但我已收到错误消息“无法验证你”无法验证您的信息

我该如何解决它?

谢谢

 
- (IBAction) sendButtonTapped: (id) sender { 
    NSString* themessage = [NSString stringWithFormat:@" %@. I'm %@ and feeling %@ about it.", 
          notesField.text ? notesField.text :@"", 
          [activities objectAtIndex:[tweetPicker selectedRowInComponent:0]], 
          [feelings objectAtIndex:[tweetPicker selectedRowInComponent:1]]]; 
    NSLog(@"Twett buttone tapped "); 

    //TWITTER BLACK MAGIC 
    NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://user name:[email protected]/statuses/update.xml"] 
                  cachePolicy:NSURLRequestUseProtocolCachePolicy 
                 timeoutInterval:60.0]; 

    [theRequest setHTTPMethod:@"POST"]; 
    [theRequest setHTTPBody:[[NSString stringWithFormat:@"status=%@", themessage] dataUsingEncoding:NSASCIIStringEncoding]]; 
    NSURLResponse* response; 
    NSError* error; 
    NSData* result = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error]; 
    NSLog(@"%@", [[[NSString alloc] initWithData:result encoding:NSASCIIStringEncoding] autorelease]); 

    //END TWITTER BLACK MAGIC 

} 
+0

你可以尝试删除状态参数? 在C#项目中,我删除状态参数,它的工作原理 – 2013-03-20 11:50:54

回答

0

要调用Twitter的Web服务的API,你得使用OAuth,读到它here