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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:42:33+00:00 2026-05-11T00:42:33+00:00

I’m working on a simple iPhone app. I have 1 UINavigationController and 2 subclasses

  • 0

I’m working on a simple iPhone app.

I have 1 UINavigationController and 2 subclasses of UIViewController.

I have a MainWindow.xib file, a PersonListView.xib, and a PersonDetailView.xib.

The MainWindow.xib has the UINavigationController with the view linked over to the PersonListView.xib file.

The PersonListView.xib has the File’s Owner listed as a PersonListViewController class.

I have some buttons on the PersonListView, along with labels and images. All displays correctly.

When I try to link a button on the PersonListView to my PersonListViewController class, the button is not firing….

The result: * Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘* -[UIViewController viewDetail]: unrecognized selector sent to instance 0x450d50′

If I go into the debug console and print-object 0x450d50, I get:

(gdb) print-object 0x450d50 (gdb)

The Interface Builder correctly shows the File’s Owner as a PersonListViewController, so why would my button action (linked to the File’s Owner) go to the superclass somehow?

EDIT1: Ok, what seems to be happening is that I wasn’t getting an instance of the subclass unless, in my MainWindow.xib, I explicitly set the class of the view controller to my subclass.

There’s still got to be something I’m missing, though, because surely I should be able to start up arbitrary subclasses of UIViewController just by swapping out the NIB file name from the main window?

EDIT2: (Response to Kevin) That’s not what I’m saying regarding the contents of a XIB.

I have 3 XIBs:

MainWindow PeopleListView PeopleDetailView

The PeopleListView and PeopleDetailView each have an associated File’s Owner that is a corresponding UIViewController subclass. Obviously, I need my events to go to the right controller classes as I move from page to page…but if I can only use a default UIViewController or one subclass, that will be much more difficult?

I can get the correct effect in code by manually setting up the UINavigationController with the correct root, but I feel like there should be a better way through InterfaceBuilder.

EDIT3: (to Kendall) I’m not using a tab bar. The model is the same, though, that the view in my navigation controller has to be wired to a single subclass, which seems a bit icky.

EDIT4: (to lostintransit) The PersonListViewController has the appropriate – (IBAction) viewDetail; method. The problem is that I can’t find a way, in my MainWindow.xib, to flag the view inside my UINavigationController as ‘initially load this from PersonListView.xib, with a PersonListViewController as the view’ that wouldn’t make it difficult to replace the PersonListView with a PersonDetailView.

  • 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. 2026-05-11T00:42:34+00:00Added an answer on May 11, 2026 at 12:42 am

    I think you are using a tab bar, correct?

    If so, think about it this way. Each tab defined in the MainWindow xib must be defined as the custom view controller type, because that is the type that the tab bar will create when it is loaded. The tab bar creates view controllers for each tab defined when it is loaded.

    It’s not enough to create an instance of just any view controller and then load your custom NIB (which is what the tab bar you have defined is doing right now), because the wiring in your custom view will have nothing to attach to.

    Thus, make sure each view controller defined under each tab in MainWindow.xib (use the tree view in IB to examine this) is set to the right custom UIViewController type in addition to pointing at your custom XIB which must ALSO have the file’s owner set to the correct type (though that’s only important if you are wiring anything to Files Owner beyond the basic view).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 77k
  • Answers 77k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer One of the relevant metric is the number of defects… May 11, 2026 at 3:30 pm
  • added an answer Check out this article that explains when this is necessary.… May 11, 2026 at 3:30 pm
  • added an answer swfobject.removeSWF('myVideoPlayer'); -- Edit: this kills off the original <DIV> that… May 11, 2026 at 3:30 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.