这是我用来将图像发布到 Twitter 的代码块。
NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"info" ofType:@"png"];
UIImage *image = [[UIImage alloc] initWithContentsOfFile:imagePath];
NSData *imageData = UIImageJPEGRepresentation(image,.05);
[_twitter postMediaUploadData:imageData fileName:@"splash_02" uploadProgressBlock:^(NSInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite) {
} successBlock:^(NSDictionary *imageDictionary, NSString *mediaID, NSString *size) {
NSLog(@"xfdf=%@",imageDictionary);
} errorBlock:^(NSError *error) {
NSLog(@"xfdferror=%@",error);
}];
我得到响应成功,但没有发布图像