2

I'm trying to post image and text to twitter. On iOS7,8 the following code works well. but only on iOS6, send button is disable. When I try to send only text, send button become enable. Only when I try to send image, send button is disable. I have to support iOS6,7,8. I have no idea why It dose not work on only iOS6 and image. Someone know the reason or had know the same trouble as this? Please advise me.
We found this problem on the iPhone4s that's iOSversion is 6.1.3.

SLComposeViewController *twvc= [SLComposeViewController composeViewControllerForServiceType:type];
[twvc setInitialText:@"a"];
if([twvc addImage:[UIImage imageNamed:@"x.jpg"]]){
    NSLog(@"IMAGE IS OK");
}else{
    NSLog(@"IMAGE IS NG");
}
[twvc addURL:[NSURL URLWithString:@"http://rara"]];

[twvc setCompletionHandler:^(SLComposeViewControllerResult result){
    // 結果判定
    switch (result) {
        case SLComposeViewControllerResultDone:
            break;

        case SLComposeViewControllerResultCancelled:
            break;

        default:
            break;
    }
    [self dismissViewControllerAnimated:YES completion:nil];
}];
[self presentViewController:twvc animated:YES completion:nil];

0 Answers0