Search Results

Search found 7 results on 1 pages for 'ttnavigator'.

Page 1/1 | 1 

  • iphone Three20 TTNavigator UITabbarController

    - by Ward
    Not sure if what I want to do makes sense, but I want to take advantage of the UITabBarController and the TTNavigator from Three20. Any tutorials around that demonstrate how this can be done? I understand how to add view controllers to the navigator using the TTURLMap, but do I need to add a navigator for each tabbar item? I'm lost.

    Read the article

  • TTNavigator three20 openURLAction

    - by disp
    I'm new to three20 and trying to find my way through the TTNavigator class. I try to push to a new view via the URL system. So I used openURL: animated: method which works just fine, but it's deprecated, and I know that I should use openURLAction instead, but this has no animated: parameter. Am I missing something?

    Read the article

  • tableView:didSelectRowAtIndexPath: calls TTNavigator openURLAction:applyAnimated: — UITabBar and na

    - by vikingosegundo
    I have an existing iphone project with a UITabBar. Now I need styled text and in-text links to other ViewControllers in my app. I am trying to integrate TTStyledTextLabel. I have a FirstViewController:UITabelViewController with this tableView:didSelectRowAtIndexPath: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSString *url; if ([self.filteredQuestions count]>0) { url = [NSString stringWithFormat:@"%@%d", @"tt://question/", [[self.filteredQuestions objectAtIndex:indexPath.row] id]]; [[TTNavigator navigator] openURLAction:[[TTURLAction actionWithURLPath: url] applyAnimated:YES]]; } else { Question * q = [self.questions objectAtIndex:indexPath.row] ; url = [NSString stringWithFormat:@"%@%d", @"tt://question/", [q.id intValue]]; } TTDPRINT(@"%@", url); TTNavigator *navigator = [TTNavigator navigator]; [navigator openURLAction:[[TTURLAction actionWithURLPath: url] applyAnimated:YES]]; } My mapping looks like this: TTNavigator* navigator = [TTNavigator navigator]; navigator.window = window; navigator.supportsShakeToReload = YES; TTURLMap* map = navigator.URLMap; [map from:@"*" toViewController:[TTWebController class]]; [map from:@"tt://question/(initWithQID:)" toViewController:[QuestionDetailViewController class]]; and my QuestionDetailViewController: @interface QuestionDetailViewController : UIViewController <UIScrollViewDelegate , QuestionDetailViewProtocol> { Question *question; } @property(nonatomic,retain) Question *question; -(id) initWithQID:(NSString *)qid; -(void) goBack:(id)sender; @end When I hit a cell, q QuestionDetailViewController will be called — but the navigationBar wont @implementation QuestionDetailViewController @synthesize question; -(id) initWithQID:(NSString *)qid { if (self = [super initWithNibName:@"QuestionDetailViewController" bundle:nil]) { //; TTDPRINT(@"%@", qid); NSManagedObjectContext *managedObjectContext = [(domainAppDelegate*)[[UIApplication sharedApplication] delegate] managedObjectContext]; NSPredicate *predicate =[NSPredicate predicateWithFormat:@"id == %@", qid]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Question" inManagedObjectContext:managedObjectContext]; NSFetchRequest *request = [[NSFetchRequest alloc] init]; [request setEntity:entity]; [request setPredicate:predicate]; NSError *error = nil; NSArray *array = [managedObjectContext executeFetchRequest:request error:&error]; if (error==nil && [array count]>0 ) { self.question = [array objectAtIndex:0]; } else { TTDPRINT(@"error: %@", array); } } return self; } - (void)viewDidLoad { [super viewDidLoad]; [TTStyleSheet setGlobalStyleSheet:[[[TextTestStyleSheet alloc] init] autorelease]]; [self.navigationController.navigationBar setTranslucent:YES]; NSArray *includedLinks = [self.question.answer.text vs_extractExternalLinks]; NSMutableDictionary *linksToTT = [[NSMutableDictionary alloc] init]; for (NSArray *a in includedLinks) { NSString *s = [a objectAtIndex:3]; if ([s hasPrefix:@"/answer/"] || [s hasPrefix:@"http://domain.com/answer/"] || [s hasPrefix:@"http://www.domain.com/answer/"]) { NSString *ttAdress = @"tt://question/"; NSArray *adressComps = [s pathComponents]; for (NSString *s in adressComps) { if ([s isEqualToString:@"qid"]) { ttAdress = [ttAdress stringByAppendingString:[adressComps objectAtIndex:[adressComps indexOfObject:s]+1]]; } } [linksToTT setObject:ttAdress forKey:s]; } } for (NSString *k in [linksToTT allKeys]) { self.question.answer.text = [self.question.answer.text stringByReplacingOccurrencesOfString:k withString: [linksToTT objectForKey:k]]; } TTStyledTextLabel *answerText = [[[TTStyledTextLabel alloc] initWithFrame:CGRectMake(0, 0, 320, 700)] autorelease]; if (![[self.question.answer.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] hasPrefix:@"<div"]) { self.question.answer.text = [NSString stringWithFormat:@"%<div>%@</div>", self.question.answer.text]; } NSString * s = [NSString stringWithFormat:@"<div class=\"header\">%@</div>\n%@",self.question.title ,self.question.answer.text]; answerText.text = [TTStyledText textFromXHTML:s lineBreaks:YES URLs:YES]; answerText.contentInset = UIEdgeInsetsMake(20, 15, 20, 15); [answerText sizeToFit]; [self.navigationController setNavigationBarHidden:NO animated:YES]; [self.view addSubview:answerText]; [(UIScrollView *)self.view setContentSize:answerText.frame.size]; self.view.backgroundColor = [UIColor whiteColor]; [linksToTT release]; } ....... @end This works quite nice, as soon as a cell is touched, a QuestionDetailViewController is called and pushed — but the tabBar will disappear, and the navigationItem — I set it like this: self.navigationItem.title =@"back to first screen"; — won't be shown. And it just appears without animation. But if I press a link inside the TTStyledTextLabel the animation works, the navigationItem will be shown. How can I make the animation, the navigationItem and the tabBar be shown?

    Read the article

  • TTNavigator doesn't use existing navigation bar (iPhone)

    - by user220770
    I am using the three20 framework in one view controller of my App. I create TTNavigator object and open a url which works fine. The problem is that TT creates it's own navigation bar and does not use the existing bar. There is no back button on the new nav bar so I cannot go back to my previous view controller. Has anybody run into this issue? Any ideas on how to fix (besides not using three20)? Thanks

    Read the article

  • Problem with TTWebController… alternative view controller template for UIWebView?

    - by prendio2
    I have a UIWebView with content populated from a Last.fm API call. This content contains links, many of which are handled by parsing info from the URL in: - (BOOL)webView:(UIWebView *)aWbView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType; …and passing that info on to appropraite view controllers. When I cannot handle a URL I would like to push a new view controller on the stack and load the webpage into a UIWebView there. The TTWebController in Three20 looks very promising since it has also implemented a navigation toolbar, loading indicators etc. Somewhat naively perhaps I thought I would be able to use this controller to display web content in my app, without implementing Three20 throughout the app. I followed the instructions on github to add Three20 to my project and added the following code to deal with URLs in shouldStartLoadWithRequest: TTWebController* browser = [[TTWebController alloc]init]; [browser openURL:@"http://three20.info"]; //initially test with this URL [self.navigationController pushViewController:navigator animated:YES]; This crashes my app however with the following notice: *** -[TTNavigator setParentViewController:]: unrecognized selector sent to instance 0x3d5db70 What else do I need to do to implement the TTWebController in my app? Or do you know of an alternative view controller template that I can use instead of the Three20 implementation?

    Read the article

  • TTLauncherItem: change badge immediately (or: how to refresh TTLauncherView)

    - by vikingosegundo
    I have a TTLauncherView with some TTLauncherItems. These show badges, representing messages from the network. I set the badges in viewWillAppear:, so if I switch to another view and then return, the correct badges are shown. But I want to update the badges as soon a message comes in. Calling setNeedsDisplay on TTLauncherView doesn't help? How can I refresh the TTLauncherView? in my MessageReceiver class I do this: TTNavigator* navigator = [TTNavigator navigator]; [(OverviewController *)[navigator viewControllerForURL:@"tt://launcher"] reloadLauncherView] ; My TTViewController-derived OverviewController @implementation OverviewController - (id)init { if (self = [super init]) { self.title = OverviewTitle; } return self; } - (void)dealloc { [items release]; [overView release]; [super dealloc]; } -(void)viewDidLoad { [super viewDidLoad]; overView = [[TTLauncherView alloc] initWithFrame:self.view.bounds]; overView.backgroundColor = [UIColor whiteColor]; overView.delegate = self; overView.columnCount = 4; items = [[NSMutableArray alloc] init]; for(int i = 1; i <= NumberOfBars; ++i){ NSString *barID = [NSString stringWithFormat:NameFormat, IDPrefix, i]; TTLauncherItem *item = [[[TTLauncherItem alloc] initWithTitle:barID image:LogoPath URL:[NSString stringWithFormat:@"tt://item/%d", i] canDelete:NO] autorelease]; [barItems addObject: item]; } overView.pages = [NSArray arrayWithObject:items]; [self.view addSubview:overView]; } -(void)viewWillAppear:(BOOL)animated { for(int i = 0; i <[barItems count]; i++){ TTLauncherItem *item = [items objectAtIndex:i]; NSString *barID = [NSString stringWithFormat:NameFormat, IDPrefix, i+1]; P1LOrderDispatcher *dispatcher = [OrderDispatcher sharedInstance]; P1LBarInbox *barInbox = [dispatcher.barInboxMap objectForKey:barID]; item.badgeNumber = [[barInbox ordersWithState:OrderState_New]count]; } [super viewWillAppear:animated]; } - (void)launcherView:(TTLauncherView*)launcher didSelectItem:(TTLauncherItem*)item { TTDPRINT(@"%@", item); TTNavigator *navigator = [TTNavigator navigator]; [navigator openURLAction:[TTURLAction actionWithURLPath:item.URL]]; } -(void)reloadLauncherView { [overView setNeedsDisplay];//This doesn't work } @end

    Read the article

  • TabBar Support of Three20 iPhone Photo Gallery

    - by dooonot
    Hi all, I wend through this tutorial and created a photo gallery for the iPhone. Now I want to add it to my TabBar project. I already heard, that Three20 doesn't support XIB, so I changed my whole tab bar setup to programmatically. I think I am not too far from a final solution. I was able to get the photo gallery working in one tab but without functions (click on a pic -- it opens, etc). There is no navigation on top of the page that leads you to the detail image page. I faced this when I removed this from didFinishLaunchingWithOptions-method in app delegate: // Override point for customization after application launch TTNavigator* navigator = [TTNavigator navigator]; TTURLMap* map = navigator.URLMap; [map from:@"demo://album" toViewController: [AlbumController class]]; [navigator openURLAction:[TTURLAction actionWithURLPath:@"demo://album"]]; return YES; I had to remove it because otherwise the whole tab bar is not shown. The photo gallery uses the whole screen. I am not sure if it is just not shown, or not loaded. I also tried: tabbar.hidesBottomBarWhenPushed = NO; But that did not work at all. I tried to add the TTNavigator-code to loadView(), viewDidLoad() and init() in the AlbumController itself without a result. Does anyone know where I have to put this in order to get it working? Thanks guys, Cheers, dooonot

    Read the article

1