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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:13:19+00:00 2026-06-02T04:13:19+00:00

I have 2 Controllers within one app as I am trying out these different

  • 0

I have 2 Controllers within one app as I am trying out these different settings.

One is a UITableViewController which the way I understand has the Delegate and the Datasource are drawn from the Superclass.

Now going by that theory I now also have a UIViewController with a UITableView on it and in the header file I have declared the Datasource and the Delegate.

So far so Good:-)

Now this is the bit I do not get:

In the implementation file I can use the tableView pointer to link data, but I am using Core Data and I have this piece of code amongst others:

- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller
  {   
  [self.tableView beginUpdates];
  }

This and 5 other situations give an error on the UIViewController if I do not setup a

IBOutlet UITableView *tableView;

Of course it is synthesized:-)

But if I declare this tableView I get a warning for a double up on the line that says this:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
[self configureCell:cell atIndexPath:indexPath];
return cell;
}

because it also declares a tableView.

So I have 2 questions:

1) Why do I have to set the IBOutlet if I have set a UITableViewDatasource and Delegate?

2) If I give the UITableViewCell a different pointer name – like tableView2, why can I not see the changes upon editing the data, but only see the result after relaunching the app?

The MasterViewController, which is the UITableViewController has not got this option.

Cheers Jeff

—ADDING IMAGES—-

enter image description here

enter image description here


To get into edit mode i have this code in the viewDidLoad

self.navigationItem.leftBarButtonItem = self.editButtonItem;

and I use this code to action what needs to be done:

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath

{
if (editingStyle == UITableViewCellEditingStyleDelete) {
NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext];
[context deleteObject:[self.fetchedResultsController objectAtIndexPath:indexPath]];

    NSError *error = nil;
    if (![context save:&error]) {
        // Replace this implementation with code to handle the error appropriately.
        // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 
        NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
        abort();
    }
}   
}

Now the + option works, but I only see the result after I relaunch the app. I can swipe and delete, but again it does not animate live within the same instance of the app.

  • 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-02T04:13:23+00:00Added an answer on June 2, 2026 at 4:13 am

    You have declared a property called tableView and presumably just synthesized it with the same name.

    UITableViewController also has a property called tableView, but the backing ivar will be called something different, probably _tableView, precisely because the default tableview datasource and delegate methods usually pass in an argument called tableView which, in the scope of the method, is clashing with your instance variable.

    Inside that method, what does tableView mean? The argument that was passed in, or your ivar?

    In answer to your specific questions:

    1. You need the outlet for those instances when your view controller needs to talk to the table view (like when you tell it to begin updates). The datasource and delegate connections are there for when the table view needs to talk to your view controller (like when it asks for a cell).

    2. I’m not sure what you are asking here, you can call the outlet to the table view anything you like but you must also alter everything that sends messages to self.tableView. For consitency I would synthesize the property like so:

      @synthesize tableView = _tableview;
      

      This prevents an ivar called tableView existing in the first place. I am assuming you haven’t declared the ivar, and have only declared the property as an IBOutlet?:

      @property (nonatomic) IBOutlet UITableView *tableView;
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app with a custom UITabBarController that contains five view controllers. Within
I have a TabBar controller with up to 9 controllers, each one has a
I have an app which goes through a set of screens within a navigation
So I have an app with a bunch (like 25+) view controllers. And these
I have a number of existing methods within a controller. Each one of those
I have 2 attributes that I use within the controllers of my MVC application.
From within my controllers action, do I have access to httpcontextbase? I have a
I have a controller within MVC3 which needs to return a response code 500
I using the Rails resource_controller plugin. I have a ReleasesController, which is nested within
i have several controllers which will all be using common functionality. So i have

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.