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

  • Home
  • SEARCH
  • 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 7407003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:38:34+00:00 2026-05-29T05:38:34+00:00

I have three levels of ViewControllers that drill down from an overall category to

  • 0

I have three levels of ViewControllers that drill down from an overall category to a subject within that category to a quote within that subject.

The view controllers are called:

1   CategoryViewController
2   SubjectViewController
3   QuoteViewController

The database table “SUBJECT” has category and subject column.

When I am in the SubjectViewController I can edit or delete subjects and categories.

I want to be able to update the data source of the parent view controller, CategoryViewController and “refresh” its tableView so when I navigate back to it, I already see the changes reflected in the displayed table.

What is the correct way to go about this?

  • 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-29T05:38:35+00:00Added an answer on May 29, 2026 at 5:38 am

    I think delegation is the most appropriate method for this task. You should create a new protocol called SubjectViewControllerDelegate and add some methods like:

    - (void)subjectViewController:(SubjectViewController*)controller didEditSubject:(Subject*)subject;
    - (void)subjectViewController:(SubjectViewController*)controller didDeleteSubject:(Subject*)subject;
    

    SubjectViewController has a delegate property to keep weak reference to its delegate.
    It calls the delegate methods whenever a data is deleted or edited.

    CategoryViewController implements this protocol and sets itself as the delegate of SubjectViewController instance before pushing it to the navigation controller. In this methods you can either refresh the all table, or just update the rows that are changed.

    UPDATE:

    Assuming that you have only one section in CategoryViewController and keep the subjects in an NSMutableArray, you can use the codes similar to below for updating the relevant part of the table view.

    - (void)subjectViewController:(SubjectViewController*)controller didEditSubject:(Subject*)subject{
        NSInteger row;
        NSIndexPath* indexPath;
        NSArray* indexPaths;
    
        row = [self.subjects indexOfObject:subject];
        indexPath = [NSIndexPath indexPathForRow:row inSection:0];
        indexPaths = [NSArray arrayWithObject:indexPath];
        [self.tableView reloadRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];    
    }
    
    - (void)subjectViewController:(SubjectViewController*)controller didDeleteSubject:(Subject*)subject{
        NSInteger row;
        NSIndexPath* indexPath;
        NSArray* indexPaths;
    
        row = [self.subjects indexOfObject:subject];
        indexPath = [NSIndexPath indexPathForRow:row inSection:0];
        indexPaths = [NSArray arrayWithObject:indexPath];
        [self.subjects removeObjectAtIndex:row];
        [self.tableView deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In our product, we have frames that are basically three inheritance levels down from
I have a drill down navigation app with three levels of UIViewControllers. In each
I have the following query to select the domain names that have three levels
I have a ul list menu that goes three levels deep. I'd like all
I have some data that goes over three levels, like this: Identifier, Key, Value
I have developed an iPhone Application that has three Levels . Those three Levels
I have a profit and loss report that currently has three levels of grouping:
Hi I have a nested cursor with three levels on it... DECLARE campaign_csr CURSOR
I have a tree structure that can be n-levels deep, without restriction. That means
I have a tree view representing certain items. This tree is always two levels

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.