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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:22:05+00:00 2026-05-29T11:22:05+00:00

I have a problem with the second app tutorial at apple tut site .

  • 0

I have a problem with the second app tutorial at apple tut site. In the main class i get an error.

The code:

#import "birdwatchingAppDelegate.h"

int main(int argc, char *argv[]) {
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([birdwatchingAppDelegate class]));
     } }

Error:

[birdwatchingViewController viewControllers]: unrecognized selector
sent to instance 0x6d37000'

The following is where the location of the error:

import "birdwatchingAppDelegate.h"
        #import "BirdSightingDataController.h"
        #import "birdwatchingViewController.h"

        @implementation birdwatchingAppDelegate

        @synthesize window = _window, dataController = _dataController, firstViewController = _firstViewController;

        - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
        {
            UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
            birdwatchingViewController *firstViewController = (birdwatchingViewController *)[[navigationController
    viewControllers] objectAtIndex:0];

            BirdSightingDataController *aDataController = [[BirdSightingDataController alloc] init];
            firstViewController.dataController = aDataController;

            return YES;
        }

and the exact line that causes problems is:

birdwatchingViewController *firstViewController = (birdwatchingViewController *)[[navigationController
    viewControllers] objectAtIndex:0];

i can’t locate the problem, can somebody help?

thanks..

EDIT:

By adding the NSlog i got following:

2012-02-10 11:24:06.059 Birdwatching[3057:f803] birdwatchingViewController
2012-02-10 11:24:06.060 Birdwatching[3057:f803] -[birdwatchingViewController viewControllers]: unrecognized selector sent to instance 0x6878250

EDIT based on comment :

2012-02-10 11:51:20.696 Birdwatching[3152:f803] navi : <birdwatchingViewController: 0x6a49c20>
  • 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-29T11:22:07+00:00Added an answer on May 29, 2026 at 11:22 am

    it’s because self.window.rootViewController is not a UINavigationController it might be simple UIViewcontroller


    Edited based upon log
    change your method to

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
            {
                birdwatchingViewController *firstViewController = (birdwatchingViewController *)self.window.rootViewController;
    
                BirdSightingDataController *aDataController = [[BirdSightingDataController alloc] init];
                firstViewController.dataController = aDataController;
    
                return YES;
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I have problem to put together animations of two separate objects to second
I have a problem about div position relative alignment. I want the second div
Here's my problem.I have 2 xmlfiles with identical structure, with the second xml containing
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
Been following the Core Data tutorial on Apple's developer site , and all is
Hey guys I have a problem with an app I'm making. The thing is
Question: I have an annoying problem with nhibernate. The problem is I cannot get
I have a problem with the Google App Engine JDO implementation that I cannot
I have the problem that starting my app on iPad shows me 2 splash-screens.
I have a problem with writing a test case for my app. At first

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.