iphone - Open Link in UIWebView in Safari -


I've have been working on an app that receives a feed which I appear in UIWebView. The feed contains embedded links that I want to open in Safari instead of WebWire. I have seen many other questions that have been posted here. I'm not sure what I'm missing, but I think it's something easy. These are my .h and .m files

 #import @class BlogRss; @ Interface Andernes del Warldwark View Controller: UIViewController {IBOutlet UIWebView * descriptionTextView; BlogRss * currently selected blogs; } @property (non-nominal, retaining) UIWebView * descriptionTextView; @protecti (readwrite, retention) BlogRss * currently selected blog items; @end  
  #import "Andernes Delivrktiwukantrolr. H" #import "BlogRss.h" @ Implementation Andernes del Warldwark View-Controller @ Sintheskes Vivrntekstwu = Vivrntaitwu; Currently Synthesized Selected BlogItim = currently selected bloglight; - (zero) viewDidoadload [[Super Viewedload]; NSString * html = [NSString stringWithFormat: @ "% @% @", the current elected Blogaitam. Title, currently selected Blogitm content encoded] in; [DescriptionTextView Load HTML String: html baseURL: [NSURL URLWithString: Zero]]; } - (BOOL) webview: (UIWebView *) Vivrntest view Chahistartlodwethrekst: (NSURLRequest *) Request Navigation Type: (UIWebViewNavigationType) navigation type {if (UIWebViewNavigationTypeLinkClicked == navigation type) Shared {[UIApplication application] openURL: [Request URL]]; no return; } Yes return; }   

Using the interface builder I have linked the iBotlet and UI webbuy. Please tell me I'm missing what I have put a break point in webview section, but the code never fails to hit, so something is not connected almost exactly like the IB.

You need to make sure that the representative of UIWebView is set to your controller. , Or you can modify your viewDidLoad method:

  - (zero) viewDidload {{Super Viewedload]; // UIWebView descriptionTextView.delegate = add this line to set the representative of self; NSString * html = [NSString stringWithFormat: @ "% @% @", currently selected blogItam.title, currently selected bloglist encoded content]; [DescriptionTextView Load HTML String: html baseURL: [NSURL URLWithString: Zero]]; }    

Comments