我在我的iPhone应用中使用Twitpic API一段时间没有问题,然后突然开始报告: 无效的用户名或密码 。
我将网址更改为yfrog,并报告: 无法找到媒体 。
我将网址更改为Posterous的网址, 正常 。
我做了一些谷歌搜索,我找不到Twitpic或Yfrog服务器的任何问题,所以我猜这是我的代码的假象 - 它有什么问题吗?
NSURL *url = [NSURL URLWithString:@"http://posterous.com/api/uploadAndPost"];
ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease];
[request setPostValue:[tmpArray objectForKey:@"Twitter Username"] forKey:@"username"];
[request setPostValue:[tmpArray objectForKey:@"Twitter Password"] forKey:@"password"];
[request setPostValue:scrapbook.short_description forKey:@"message"];
[request setData:scrapbook.image forKey:@"media"];
NSLog(@"User: '%@', pass: '%@'", [tmpArray objectForKey:@"Twitter Username"], [tmpArray objectForKey:@"Twitter Password"]);
[request setDelegate:self];
[request startAsynchronous];
[tmpArray objectForKey:@"Twitter Username"] and [tmpArray objectForKey:@"Twitter Password"] hold my username and password respectively as NSStrings, scrapbook.short_description is an NSString and scrapbook.image is NSData.
NSLog输出正确的用户名和密码。
答案 0 :(得分:0)
我无法在您的代码中看到错误,也许问题是来自Twitter http://apiwiki.twitter.com/Rate-limiting的速率限制。但到目前为止,我还没有听说过Twitpic-API的速率限制。