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 6592893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:36:48+00:00 2026-05-25T17:36:48+00:00

When I touch cancel button in the third view, I want to go back

  • 0

When I touch cancel button in the third view, I want to go back to the first view directly. How can I do that?

This is the code.

// this part is in the first view.
SecondController *aSecondController = [[SecondController alloc] init];
UINavigationController *aNaviController = [[UINavigationController alloc] initWithRootViewController:aSecondController];
self.naviController = aNaviController;
[aNaviController release];
[aSecondController release];
[self.view addSubview:naviController.view];

// this part is in the second view.
ThirdController *thirdController = [[ThirdController alloc] initWithStyle:UITableViewStyleGrouped];             
[self.navigationController pushViewController:thirdView];
[thirdView release];

// this part is in the third view.
- (void)cancel {
    [self.navigationController popViewControllerAnimated:NO]; // this only goes to the second view.
}

popToViewController, popToRootViewController only go to the second view also.

  • 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-25T17:36:48+00:00Added an answer on May 25, 2026 at 5:36 pm

    Set up the navigation controller in your app delegate. Make the first view controller the nav controller’s root controller instead of having the first view controller own the nav controller. Then you can use -popToRootViewController:animated: as the other answers have suggested.

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

Sidebar

Related Questions

I have an overlay that I want to slide in my cocoa-touch application. I
I have a touch screen kiosk that displays a webpage and a pdf document.
How do I manually touch a UIView means programattically. I want to touch a
How would you emulate touch-screens? I wouldn't want to pay $ to get a
Can i create custom touch events for iPhone?? will the device support for creating
Is that possible to display options in uiwebview links. When you touch and hold
Can multi-touch events be tested on the Android Emulator? Or is there any way
The UIAlertViewDelegate protocol states the following: // Called when we cancel a view (eg.
I have a Sencha Touch 1.1/Phonegap 1.3 application that works correctly on the iPad
With the SDK / Cocoa Touch, is it feasible to make an app that

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.