2013-06-24 20 views
3

當您在iOS上使用SLComposeViewController時,如何才能獲得您的tweet的108個字符,而不是通常的140個字符?SLComposeViewController中的108個字符

顯示在下面的屏幕截圖... enter image description here

我使用下面的代碼創建這個SLComposeViewController ...

- (IBAction)compose:(id)sender { 
    if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) { 
     SLComposeViewController *composeViewController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter]; 
     [composeViewController addImage:[UIImage imageNamed:@"twitter_logo.png"]]; 
     [composeViewController setCompletionHandler:^(SLComposeViewControllerResult result) { 
      if (result == SLComposeViewControllerResultDone) { 
       UIAlertView *success = [[UIAlertView alloc] initWithTitle:@"Success" message:@"Your tweet was successfully posted!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; 
       [success show]; 
      } 
      else { 
       [self dismissViewControllerAnimated:YES completion:nil]; 
      } 
     }]; 
     [self presentViewController:composeViewController animated:YES completion:nil]; 
    } else { 
     UIAlertView *error = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Error" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; 
     [error show]; 
    } 
} 

我在做什麼錯?

+1

我認爲回形針是圖像是附件的提示。 –

回答

3

我想通了這是爲什麼發生。

我不知道,[composeViewController addImage:[UIImage imageNamed:@"twitter_logo.png"]];在技術上張貼鏈接到圖片在鳴叫一樣,http://pic.twitter.com/7Fsa2kadf使佔用了32個字符的鳴叫。

如果我註釋掉了這行代碼,它是140個字符。

也許蘋果會在未來的更新中顯示鏈接。

相關問題