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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:37:05+00:00 2026-05-31T10:37:05+00:00

I have Navigation controller as intial view which goes into view controller now i

  • 0

I have Navigation controller as intial view which goes into view controller

now i have table view after this view

Nav controller > UI View Controller > Table view

Issue occurs here

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{   
    UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
    MasterViewController2 *controller = (MasterViewController2 *)navigationController.topViewController;
    controller.managedObjectContext = self.managedObjectContext;
    return YES;
}

app builds and fails with this message

'NSInvalidArgumentException', reason: '-[ViewController setManagedObjectContext:]: unrecognized selector sent to instance 0x8e22df0'

any idea why its failing and crashing app even though there is no build errors or warnings?

  • 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-31T10:37:06+00:00Added an answer on May 31, 2026 at 10:37 am

    You need to set the class of your view controller in the storyboard to MasterViewController2. The exception is showing you that the object is of type ViewController with the message '-[ViewController setManagedObjectContext:]:. This is in the identity inspector (View → Utilities → Show Identity Inspector with your view controller selected).

    • 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 which also has a table view. I want to
Sup fellas, so I have a navigation controller with a table view to which
In my IB I have a navigation controller which has in it a view
I have a navigation controller based application and I'm running into a strange issue
I have added navigation controller into my appication in didFinishLaunchingWithOptions like this LoginViewController *mainView
I have a core data application which uses a navigation controller to drill down
I have a Navigation Controller with a View Controller displaying a button. The button
I have my navigation controller and my view controller. I can't seem to get
I have a navigation controller which I push a new tableviewcontroller for each received
I have a navigation controller and in it a view controller: -NavigationController1 --MyViewController And

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.