Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4023598
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:37:05+00:00 2026-05-20T10:37:05+00:00

I am starting to work with the Three20 library and created a UIButton using

  • 0

I am starting to work with the Three20 library and created a UIButton using the following code:

self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Add New" 
                                                                           style:UIBarButtonItemStyleBordered
                                                                          target:@"tt://samples/new"
                                                                          action:nil] autorelease];

When the user touches the button, I would like to push an instance of NewSampleViewController onto the nav. I have added the following in my app delegate’s -didFinishLaunchingWithOptions method:

[map from:@"tt://samples/new" toViewController:[NewSampleViewController class]];

As it stands, when the button is touched, nothing happens at all. Nothing happens on the device and I don’t see any logging going on in the console.

What have I done wrong or missed here?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:37:06+00:00Added an answer on May 20, 2026 at 10:37 am

    Unless there is something magical I haven’t discovered yet, I don’t think you’ve wired your button delegation correctly. It looks like you’ve told the button that the string @”tt://samples/new” is the object that receives the press event and you want it to send no message (call no method / nil).

    Create a method in the view controller with the button, such as this:

    - (void)addButtonPressed:(id)sender{
      TTURLAction *urlAction = [TTURLAction actionWithURLPath:@"tt://samples/new"];
      [[TTNavigator navigator] openURLAction:urlAction];
    }
    

    Then replace your button init with this:

        self.navigationItem.rightBarButtonItem = 
              [[[UIBarButtonItem alloc] initWithTitle:@"Add New" 
                                                style:UIBarButtonItemStyleBordered
                                               target:self
                                               action:@selector(addButtonPressed:)]
               autorelease];
    

    This will invoke the TTNavigator singleton instance to open the action created with the string path provided. The button needs to be handled by a button delegate and self, your view controller, is perfectly appropriate for that. The handler method then causes a three2 navigation using a path. If you’ve got things wired correctly in your appDelegate, three20 will create and push the view controller you mapped.
    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm starting work on a project using Rails, but I'm waiting for the 3rd
I'm starting work on some simulations using MPI and want to do the programming
I am starting work on a SharePoint 2010 Project and using the Visual Studio
I'm starting work on a program which is perhaps most naturally described as a
I'm thinking about starting work on a fairly large scale .NET or ASP.NET project
I am starting to work on a hobby project with a Python codebase and
I'm starting to work with my model almost exclusively in WCF and wanted to
I'm currently a .NET developer, but I'm starting to work with Flex a little
I am starting a new client/server project at work and I want to start
I'm working on a project and I'm just starting to do all the work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.