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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:51:22+00:00 2026-05-17T16:51:22+00:00

I have a navigation controller based app. My views consist of two tableviews laid

  • 0

I have a navigation controller based app. My views consist of two tableviews laid out like this:

Category
    Item within category

Basically i allow users to create the categories using the + button on the navigation bar. Then they select a category, and can then press the + button again to create items in that category.

My problem is if i create a category, and add some items, then go back up and choose a different category, the same items from the first category are displayed.

This is what i use to create my item controllers in didSelectRow:

if (detailViewController==nil) 
     detailViewController = [[ItemViewController alloc] init];

 detailViewController.category = [[APP_DELEGATE listsArray] objectAtIndex:indexPath.row];
 [self.navigationController pushViewController:detailViewController animated:YES];

From viewDidLoad in ItemViewController:

items = [[NSMutableArray alloc] initWithCapacity:30];

How can i stop the same items being displayed for each?

Thanks

EDIT:

Code that populates items:

- (void)addNameController:(AddName *)addNameController didAddName:(NSString *)name {

if (name) {
    NSLog(@"%@", name);
    [items addObject:name];
    [self.tableView reloadData];
}
[self dismissModalViewControllerAnimated: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-17T16:51:23+00:00Added an answer on May 17, 2026 at 4:51 pm

    Move the initialization of the items array to viewDidAppear in ItemViewController and call reloadData. The viewDidLoad is only getting called the first time ItemViewController is alloc’d and pushed.

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

Sidebar

Related Questions

I have a navigation controller-based app in which I would like to temporarily disable
I have a page which work like a navigation and a iframe in this
I've got a navigation controller based app that downloads an RSS feed and lays
I have a navigation controller based application and I'm running into a strange issue
I have a navigation based iPhone app. When you press on a cell in
Im writing an app that I would like to display different views based on
I have a tabbar-based iOS app with two tabs. When I tab into the
I have a navigation based iPhone app. Normally you start on the RootViewController, there
Let's say I have a list of categories for navigation on a web app.
i am making a tabbar based app, but the problem is I have several

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.