私はIFTweetLabelを使用していて、リンクを認識できるようになっていますが、IFTweetLabelが作成するボタンでWebビューを開くのにひどい時間を過ごしています。NSLogを実行していると、ボタンが押されたときに各リンクを理解していることがはっきりとわかりますが、何らかの理由でURLが開かれません。
以下は、ビューを表示し、webViewに文字列をロードするために使用しているコードです。これはすべてWebビューのロード以外に機能します。
どんな提案でも大歓迎です!ありがとう!
- (void)handleTweetNotification:(NSNotification *)notification
{
[UIView beginAnimations:@"animateView" context:nil];
[UIView setAnimationDuration:1.0];
CGRect viewFrame = [MainwebView frame];
viewFrame.origin.x = 220;
MainwebView.frame = viewFrame;
MainwebView.alpha = 1.0;
web.alpha = 1.0;
MainwebView.layer.shadowColor = [[UIColor blackColor] CGColor];
MainwebView.layer.shadowOffset = CGSizeMake(1.0f, 1.0f);
MainwebView.layer.shadowRadius = 8.0f;
MainwebView.layer.shadowOpacity = 1.0f;
[self.view addSubview:MainwebView];
[UIView commitAnimations];
[web loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:tweetLabel.text]]];
NSLog(@"handleTweetNotification: WTF notification = %@", notification);
}