2
포스트 이미지를 게시하지만 imahe없이 트윗을 게시하는 경우는 FHSTwitterEngine의 현재 버전 및 게시 이미지에 문제가 있습니다FHSTwitterEngine 이미지가 오류를 반환 <strong>FHStwitterEngine</strong>으로
-(void)postTweet:(NSString*)message withImage:(UIImage*)img {
dispatch_async(GCDBackgroundThread, ^{
@autoreleasepool {
NSString *strMsg =[NSString stringWithFormat:@"%@",message];
NSData *imgData =UIImagePNGRepresentation(img);
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
NSError *returnCode = [[FHSTwitterEngine sharedEngine]postTweet:strMsg withImageData:imgData];
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
NSString *title = nil;
NSString *message = nil;
if (returnCode) {
title = [NSString stringWithFormat:@"Error %d",returnCode.code];
message = returnCode.localizedDescription;
} else {
title = @"Tweet Posted";
message = message;
}
dispatch_sync(GCDMainThread, ^{
@autoreleasepool {
UIAlertView *av = [[UIAlertView alloc]initWithTitle:title message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[av show];
}
});
}
});
}
- (IBAction)btnPost:(id)sender {
NSString *str [email protected]"Test5";
UIImage *image =[UIImage imageNamed:@"contact.png"];
if (image ==nil) {
[self postTweet:str];
}else {
[self postTweet:str withImage:image];
}
}