2013-05-25 4 views
0

xcode에서 기본적으로 당신이 트위터에 뭔가를 게시 할 수있게 해주는 프로그램을 만들고 있습니다. 모든 것은 내가 구글을 말하는 하이퍼 텍스트를 게시하는 방법을 찾아 내려고한다는 것을 제외하면 작동합니다. Forexample 예를 들어 wwww.google.com이라는 단어를 클릭하면 google로 연결되기를 원합니다. 모든 도움을 주시면 감사하겠습니다. 감사합니다iOS 앱에서 링크를 트위터에 보내기

이 당신은 트윗에서 하이퍼 텍스트를 사용할 수 없습니다 코드

-(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]; 
    } 
} 

답변

2

,하지만 당신은 URL을 포함하는 경우 자동으로 트위터에 의해 당신을 위해 연결해야합니다. Twitter는 일반적으로 URL 단축키도 사용합니다. 다음과 같은 형식을 사용하십시오.

NSString *tweet = @"This is a link to http://google.com"; 
+0

감사합니다. –

관련 문제