-(IBAction)btnPostclick
{NSURL *url = [NSURL URLWithString:@"http://yfrog.com/api/uploadAndPost"];
ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease];
[request setDelegate:self];
if (IMG)
{
if([galleryImageView.image description] == NULL)
{
[request setData:UIImageJPEGRepresentation([UIImage imageNamed:@"logo.png"], 0.8) forKey:@"media"];
}
else
{
[request setData:UIImageJPEGRepresentation(galleryImageView.image, 0.8) forKey:@"media"];
}
}
else
{
[request setData:UIImageJPEGRepresentation([UIImage imageNamed:@"logo.png"], 0.8) forKey:@"media"];
}
[request setPostValue:userdata.twitterUserName forKey:@"username"];
[request setPostValue:userdata.twitterPassword forKey:@"password"];
[request setPostValue:comm forKey:@"message"];
[request startAsynchronous];
[request setDidFinishSelector:@selector(requestDone:)];
[request setDidFailSelector:@selector(requestFailed:)];}
我使用yfrog API来分享图片和推文。
我使用ASIFormDataRequest
调用上述API。我设置了我的推特用户名&请求中的密码。该请求是异步调用的。
当响应到达时-(void)requestDone:(ASIHTTPRequest *)request
方法会自动被调用。
我在
-(void)requestDone:(ASIHTTPRequest *)request
{
NSString *response = [request responseString];
NSLog(@"Response -> %@",response);
}
但它不会在我的推特账号上发送推文。 任何人都可以解决这个问题吗?
应用的基础SDK是:iOS 4.3
应用的部署目标是:3.1.3
提前致谢。