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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:38:27+00:00 2026-06-16T20:38:27+00:00

I have four view controller classes A, B, C, D. Class D is pushed

  • 0

I have four view controller classes A, B, C, D.

Class D is pushed when the “go” button is pressed from Class A & B.

I have a method in the app delegate which does that for me

-(void)showViewController {
    self.ViewController = [[[ViewController alloc] initWithNibName:@"View"     bundle:nil] autorelease];
    [self.navigationController pushViewController:self.ViewController animated:YES];
}

When the “back” button is pressed from Class D it pops back to either class A & Class B depending on which class pushed Class D

- (void)popViewController {
    [self.navigationController popViewControllerAnimated:YES];
}

What I want to implement is suppose if Class A pushes Class D but when the “back” button is pressed in Class D i want it to go to Class C instead of Class A

I have tried to implement the following code

-(void)popToViewController{
    [self.navigationcontroller popToViewController:self.ClassCViewController animated:YES]
}

This causes changes in Class B which i do not want.

Any Suggestions ?

  • 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-06-16T20:38:27+00:00Added an answer on June 16, 2026 at 8:38 pm

    So what I would suggest to you is that you take some time and read up on the apple documentation concerning delegates. They will do exactly what you want here where two views can have the same child view. From there have the child view call the delegate to figure out what it needs to do.

    Another thing to keep in mind is that it is good practice to have any view that pushes a view to also be the one responsible for popping that view.

    EDIT: Just to help you with your original question and get you thinking down the right path. When the back button is pressed in Class D. You would want it to call a method on the delegate (which could be either class A or Class B) from there you could make it go to either the same class. Or if you want to present another view have the delegate view present Class C. Using delegates allows you to have Class A present Class C while allowing Class B to just stay at B when back is pressed. I hope this answers your question.

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

Sidebar

Related Questions

I am creating a split view ipad app. I have four buttons in the
In my app I have a scroll view and four table views. Each time
I have an admin view which contains four foreign keys each with a few
I have four classes which share some arrangement of four properties. I have currently
In my Application first i have some Login View Controller,after login with button action
I'm developing custom Media Controller and i have taken four button(play/pause,next,pre and bandwidth)inside a
So below is my code for my controller, which I have four of one
Ok heres the situation. I have a View controller class that serves as the
I have this Rails code in a method in a controller. It takes four
I have a partial view which has dual list boxes and four buttons; exactly

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.