TWRequest に渡すURLを変更して解決
実際に TWRequest 作っている部分はこんな感じ。
// Create a request, which in this example, posts a tweet to the user's timeline. // This example uses version 1 of the Twitter API. // This may need to be changed to whichever version is currently appropriate. TWRequest *postRequest = [[[TWRequest alloc] initWithURL:[NSURL URLWithString:@"http://api.twitter.com/1/statuses/update.json" parameters:[NSDictionary dictionaryWithObject:tweetString forKey:@"status"] requestMethod:TWRequestMethodPOST] autorelease]; // Set the account used to post the tweet. [postRequest setAccount:twitterAccount];
Appleのサンプルから思い切り持ってきました!ってコードなのだけど、ちゃんとコメントに書いてあったね〜。
というわけで、USURL 作る所の URLを 1.1バージョンにして解決。
TWRequest *postRequest = [[[TWRequest alloc] initWithURL:[NSURL URLWithString:@"http://api.twitter.com/1.1/statuses/update.json" parameters:[NSDictionary dictionaryWithObject:tweetString forKey:@"status"] requestMethod:TWRequestMethodPOST] autorelease];
ところでこの問題、自分の持っている iOS 6.1.4 の iPhone 5だとエラーが出て、iOS 5.1.1の iPhone 4だとエラーが出ないんだけど…。
iOS 5の中で URL をごにょごにょしてくれてたり…しないよな〜。
俺、何をやっちゃってんだろう???