three20 - TTNavigator not opening URLs when clicking on links in TTStyledTextLabels -
A simple link click activity is trying to work, I think I understand TTNavigator and TTStyledLabel, but it Can not get to work.
Code:
@interface SomeVc: UIViewController & lt; TTNavigatorDelegate & gt; {IBOutlet TTStyledTextLabel * Style TextLabel; } @end @implementation SomeVc - (zero) viewDidoadload {[Super Viewedload]; Sailor = [TTNvigator Navigator]; Navigator.EstitionsSmode = TTNVigatorCirciansSamodNon; Navigator.delegate = self; TTURLMap * Map = Navigator. URLMap; [From Map: @ "*" To View Controller: [TT WebCentron Class]]; StyledTextLabel.text = [URL with TTStyledText Text: some text]; [Navigator OpenRoklayation: [TTRAC Action Action with URL Path: @ "http://www.cnn.com/"]; } - (BOOL) Navigator: (TTNvigator *) Navigator should be open URL: (ns URL *) URL {NSLOG (@ "trying to open% @", [full string of url]); no return; } @end
Within a visual controller, get the Navigator and set yourself as your representative. When a link is opened, then OpenRell Delgate method is called, where I have to handle myself by opening the URL (I'm planning to handle the Navigator more about it, but want to do this simple case first I am.)
I have a test call at the end of the scene: Adid: which fixes the representative method.
Problem: I look at the style text label presented properly with the URL, but when I tap on them, nothing happens, they do not reach TTNVigator for some reason and I do not understand why it seems that I'm missing some simple connections / maps, but I do not understand it.
How to do so that the link wrapped in the stylish fabric will reach the Navigator representative? Or how do I implement this simple matter with styleextable? (Just want to get callback for URL tap.)
attempt to set window property Do:
TTNvigator * Navigator = [TTNvigator Navigator]; Navigator.windows = window;
If you do not have one, you can add one
navigator.windows = [[UI window light] initWithFrame: [[UIScreen main screen ] Limitations]]
You may also need it:
[navigator.window makeKeyAndVisible];
Comments
Post a Comment