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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:40:31+00:00 2026-06-12T19:40:31+00:00

First of all I don’t know If controller is the right word. What I

  • 0

First of all I don’t know If controller is the right word. What I want to achieve is this.

   @interface ClubViewController : CoreDataTableViewController :NRGridViewController
   {

I know that this is not possible in objective-C. But is there a way to work around this?
Because I want to use CoreDateTableViewController and NRGridViewController.

Kind regards

Stef
EDIT

This is how my storyboard Hierarchy looks like.

-ViewController
  -TableView
      -View
      -TableViewCell

So I have a tableview Controller but above this tableview controller you find a small view with three buttons. When I push on button 1 I want to take the tableview away and draw a gridView with the NRGridview Controller. But when I push on button 2 and 3 I fill up my tableview using the CoreDataTableViewController.

I hope this explains more my problem.

  • 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-12T19:40:34+00:00Added an answer on June 12, 2026 at 7:40 pm

    I think one way to do this is with a container view with a container view controller inside it. That container controller would have 2 child controllers which would be your CoreDateTableViewController and NRGridViewController. I’ve implemented something like this, and I can show you some code if you’re interested.

    After Edit: In a test app, I started with a single view template and a storyboard. I added two buttons to the top of the view and a container view to the bottom half of the view (this first controller is of class ViewController). I then dragged out a new view controller, and control dragged from the container view to the new controller and chose the “embed segue” (this will resize the view to be the same size as the container view). The class of this controller was changed to my subclass, ContainerController. I then created 2 more controllers for the 2 views that will be managed by the container controller (the views need to have their size set to “freeform” in IB so you can set the size to be the same as the container view). Here is the code in ContainerController:

    - (void)viewDidLoad
    {
        [super viewDidLoad];
        self.cont1 = [[FirstController alloc]initWithNibName:@"FirstView" bundle:nil];
        self.cont2 = [[SecondController alloc]initWithNibName:@"SecondController" bundle:nil];
        [self addChildViewController:self.cont1];
        self.currentController = self.cont1;
        [self.view addSubview:self.cont1.view];
    }
    
    -(void)switchToFirst {
        if (self.currentController != self.cont1) {
            [self addChildViewController:self.cont1];
            [self moveToNewController:self.cont1];
        }
    }
    
    -(void)switchToSecond {
        if (self.currentController != self.cont2) {
            [self addChildViewController:self.cont2];
            [self moveToNewController:self.cont2];
        }
    }
    
    -(void)moveToNewController:(id) newController {
        [self.currentController willMoveToParentViewController:nil];
        [self transitionFromViewController:self.currentController toViewController:newController duration:.6 options:UIViewAnimationOptionTransitionFlipFromLeft animations:^{}
                                completion:^(BOOL finished) {
                                    [self.currentController removeFromParentViewController];
                                    [newController didMoveToParentViewController:self];
                                    self.currentController = newController;
                                }];
    }
    

    The only code I have in ViewController are the IBActions for the 2 buttons that switch the views. Those methods just call methods in the container controller:

    -(IBAction)chooseFirstController:(id)sender {
        [self.childViewControllers.lastObject switchToFirst];
    }
    
    -(IBAction)chooseSecondController:(id)sender {
        [self.childViewControllers.lastObject switchToSecond];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all I don't know if this is the right approach. I want
First of all I don't know whether this is the right place for this
First at all - I don't know if render is the right word. I
First of all I don't know if it this question belongs here if not
Hi All First of all I don't know Javascript, I got this script from
First of all I don't know if this is a dumb question. I have
First of all, I know about the command line parameter, but I don't want
First of all, I don't know if this should stay in SO or go
First of all i don't know whether the title is relevant or not (please
First of all, I don't want to use a join because that will make

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.