在iOS 5上,我嘗試使用動態哈希標籤搜索詞打開本機twitter應用程序。使用散列標籤搜索打開本機twitter應用程序
我已經試過:
- (void)openForHashTag:(NSString *)hashTag {
UIApplication *app = [UIApplication sharedApplication];
NSURL *twitterURL = [NSURL URLWithString:[NSString stringWithFormat:@"twitter://search?q=%@", hashTag]];
DLog(@"Hashtag URL: %@ ", twitterURL);
if ([app canOpenURL:twitterURL]) {
[app openURL:twitterURL];
}
else {
NSURL *safariURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://mobile.twitter.com/search?q=%@", hashTag]];
[app openURL:safariURL];
}
}
似乎去包括hashtag搜索頁面,但花費永遠載入中...是twitter://search?q=%@
格式錯誤?
這是正確的答案 – capikaw