从iOS应用程序推特链接
我正在用xCode创建一个程序,基本上可以让你在twitter上发布一些东西。一切都正常,除了我试图找到一种方法来发布一条超文本,这将导致人们说谷歌。 例如,当我点击WW.google.com这个词时,我希望它能指向谷歌。任何帮助都将不胜感激。谢谢 这是密码从iOS应用程序推特链接,ios,twitter,slcomposeviewcontroller,Ios,Twitter,Slcomposeviewcontroller,我正在用xCode创建一个程序,基本上可以让你在twitter上发布一些东西。一切都正常,除了我试图找到一种方法来发布一条超文本,这将导致人们说谷歌。 例如,当我点击WW.google.com这个词时,我希望它能指向谷歌。任何帮助都将不胜感激。谢谢 这是密码 -(void)tweetTapped{ if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) { SLCo
-(void)tweetTapped{
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
[tweetSheet setInitialText:@"Post to Twitter :) www.google.com"];
[self presentViewController:tweetSheet animated:YES completion:nil];
}
else
{
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle:@"Sorry"
message:@"You can't send a tweet right now, make sureyour device has an internet connection and you haveat least one Twitter account setup"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
}
}
你不能在tweet中使用超文本,但如果你包含一个URL,它应该通过Twitter自动为你链接。Twitter通常也会使用URL缩短器。因此,只需使用如下格式:
NSString *tweet = @"This is a link to http://google.com";