【发布时间】:2011-03-19 11:21:34
【问题描述】:
消息下方是我的代码。但我收到了错误消息“无法验证您”
我该如何解决?
谢谢
-(IBAction)sendButtonTapped:(id)发件人{ NSString*message = [NSString stringWithFormat:@" %@。我是 %@ 并且对它有 %@ 的感觉。", notesField.text ? notesField.text :@"", [活动对象AtIndex:[tweetPicker selectedRowInComponent:0]], [感觉 objectAtIndex:[tweetPicker selectedRowInComponent:1]]]; NSLog(@"Twett buttone 点击"); //推特黑魔法 NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://user name:password@twitter.com/statuses/update.xml"] cachePolicy:NSURLRequestUseProtocolCachePolicy 超时间隔:60.0]; [theRequest setHTTPMethod:@"POST"]; [theRequest setHTTPBody:[[NSString stringWithFormat:@"status=%@",message] dataUsingEncoding:NSASCIIStringEncoding]]; NSURLResponse* 响应; NSError* 错误; NSData* 结果 = [NSURLConnection sendSynchronousRequest:theRequest returnedResponse:&response error:&error]; NSLog(@"%@", [[[NSString alloc] initWithData:result encoding:NSASCIIStringEncoding] autorelease]); //结束推特黑魔法 }【问题讨论】:
-
您可以尝试删除状态参数吗?在 C# 项目中,我删除了 status 参数并且它可以工作