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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:34:38+00:00 2026-06-14T18:34:38+00:00

My App’s update needs a setup where the user can choise which view to

  • 0

My App’s update needs a setup where the user can choise which view to load.
So since I’m using storyboards I managed to create a view controller which is connected via the storyboard to another view which acts as the “root view controller”

Then I added the following code to that view, I’m using an example string here to test if the code works.

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSString *test = @"one";

    id rootController;
    if (test == @"one") {
        rootController = [self.storyboard instantiateViewControllerWithIdentifier:@"one"];


    } else if (test == @"two") {
        rootController = [self.storyboard instantiateViewControllerWithIdentifier:@"two"];

    }
    else if (test == @"three") {
        rootController = [self.storyboard instantiateViewControllerWithIdentifier:@"three"];

    }

    else {
        rootController = [self.storyboard instantiateViewControllerWithIdentifier:@"none"];

    }
    self.view = [NSArray arrayWithObjects:rootController, nil];
}

But whenever the app launches the following exception throws up:

2012-11-23 16:30:40.482 MyApp[1587:c07] -[__NSArrayI _setViewDelegate:]: unrecognized selector sent to instance 0x716cf30
2012-11-23 16:30:40.501 MyApp[1587:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI _setViewDelegate:]: unrecognized selector sent to instance 0x716cf30'
*** First throw call stack:
(0x1c8e012 0x10cbe7e 0x1d194bd 0x1c7dbbc 0x1c7d94e 0xf85ac 0xf4a90 0x2dee 0xf4817 0xf4882 0xf4b2a 0x10bef5 0x10bfdb 0x10c286 0x10c381 0x10ceab 0x10cfc9 0x10d055 0x2123ab 0x6392d 0x10df6b0 0x228afc0 0x227f33c 0x228aeaf 0x1028cd 0x4b1a6 0x49cbf 0x49bd9 0x48e34 0x48c6e 0x49a29 0x4c922 0xf6fec 0x43bc4 0x43dbf 0x43f55 0x4cf67 0x10fcc 0x11fab 0x23315 0x2424b 0x15cf8 0x1be9df9 0x1be9ad0 0x1c03bf5 0x1c03962 0x1c34bb6 0x1c33f44 0x1c33e1b 0x117da 0x1365c 0x21dd 0x2105)
libc++abi.dylib: terminate called throwing an exception

Why is the code not working?

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

    If you’re using Storyboards you should also use Segues, which were introduced the same time as Storyboards for iOS5.

    In your MainStoryboard.storyboard you’ll have your root ViewController and three more ViewControllers showing. Select your root ViewController, ctrl + left click and drag onto another of the ViewControllers and release. You’ll see a little black dialog appear which says Manual Segue (pronounced seg-way), select Modal.

    You’ll now see a line connecting those two ViewControllers. Click the line and in the right hand tool bar (inspector) and select the Attributes Inspector tab button. Give the segue the Identifier “One”.

    Now in the Root View controller, add the following method in the ViewDidLoad method:

      if ([test isEqualToString:@"one"]) {
            [self performSegueWithIdentifier:@"one" sender:nil];
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My app uses LoadLibrary to load plugins at run-time and users can accidentally try
App having screen1, screen2, screen3 , screen4 user can go to screen3 from remaining
My app needs to keep an index of files in which the files are
My app is a sync solution (imagine dropbox). The user needs to sign in
My app is slowed down by N+1 queries. I'm using the will_paginate gem with
App has fragment activity with framelayout container matching parent. User interacts with fragments ui
We're building an app, our first using Rails 3, and we're having to build
My app uses the android.support.v4.view.ViewPager class. For each page in the ViewPager, I want
'app name' specifies a minimum os of version 4.3, which is too high to
/app.js var Welcome = Ember.Application.create({}); Welcome.person = Ember.View.extend({ personName: 'Andrew' }); Here is 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.