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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:44:15+00:00 2026-05-23T03:44:15+00:00

i have viewcontroller with table view that when i click on a cell i

  • 0

i have viewcontroller with table view that when i click on a cell i go in the navigation to another view controller with another tableview.

i try to use the viewDidAppear and viewWillAppear in the first viewcontroller, that when i back to this viewcontroller from the second viewcontroller i will enter one of this method.

the problem is that he didn’t enter this method when i return to this viewcontroller.

this is how i enter the second view controller:

 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
        ProfileViewController2 *tmp = [[ProfileViewController2 alloc]initWithType:indexPath.row string:[self.array2 objectAtIndex:indexPath.row]];
        [[self navigationController] pushViewController:tmp animated:YES];
        [tmp release];
        [self.mytableview deselectRowAtIndexPath:indexPath animated:YES];
    }
  • 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-23T03:44:15+00:00Added an answer on May 23, 2026 at 3:44 am

    viewWillAppear and viewDidAppear are notoriously shaky on iOS.

    If you are working with UITableViews we always put the code we need to run before the table gets loaded into the

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
    

    function. It’s a slight hack but works very well as this is the first function out of the UITableViewDataSource protocol called.

    Alternatively, you can call

        [tmp viewDidAppear];
    

    After pushing the view controller and before releasing tmp to force the function being called.

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

Sidebar

Related Questions

I have a viewController (Planner) that loads two view controllers (InfoEditor and MonthlyPlan) when
I have a movie file that does work. I added a tableview controller inside
I have a View Controller that is swapping UIView objects in and out. There
So I have a view controller with a single UITableView that shows a string
I have a root view controller as the navigation controller. In the root view
I have a ViewController that needs to use 2 UITableViews . 1 is always
Lets say I have a view, myView, a view controller, myViewController, and some sort
A simple question: I have a Model-View-Controller setup, with Models accessing a SQL database.
I have a didSelectRowAtIndexPath action that adds a navigation bar and displays a new
how can i know what tableview cell was selected?(being in the detail view) The

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.