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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:30:57+00:00 2026-06-15T02:30:57+00:00

I am trying to to complete the ‘Your Second iOS App’ tutorial from the

  • 0

I am trying to to complete the ‘Your Second iOS App’ tutorial from the apple developer program. It is a basic tableView app. My problem is that the app is building successfully and without warnings, however I cannot get the detail view to segue from the master view. I have copied and pasted both the segue identifier and the code that apple has provided. The segue is using push and I have deleted it and tried again several times. I am testing the app in the simulator.

  1. How can I tell if a segue is working?

  2. Every time I copy/paste my code from Xcode into the stack overflow question text area, I get warnings at the bottom saying that code must be indented by 4 spaces??? Does this mean I have to go line-by-line indenting code?? I did the control + k and pasted in the highlighted area, however I still got the warning??

  3. When running the simulator and looking at it, I’m trying to use a disclosure indicator by clicking on it, do I have to push something special like control = click or command = click, etc. ?

Here is the code for BirdsMasterViewController.m file:

            //
            //  BirdsMasterViewController.m
            //  BirdWatching
            //
            //  Created by David Hall on 11/13/12.
            //  Copyright (c) 2012 David Hall. All rights reserved.
            //

            #import "BirdsMasterViewController.h"

            #import "BirdsDetailViewController.h"

            #import "BirdSightingDataController.h"

            #import "BirdSighting.h"

            /*
            @interface BirdsMasterViewController () {
                NSMutableArray *_objects;
            }
            @end
            */
            @implementation BirdsMasterViewController

            - (void)awakeFromNib
            {
                [super awakeFromNib];

                self.dataController = [[BirdSightingDataController alloc] init];
            }

            - (void)viewDidLoad
            {
                [super viewDidLoad];
                // Do any additional setup after loading the view, typically from a nib.
            /*
                self.navigationItem.leftBarButtonItem = self.editButtonItem;

                UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)];
                self.navigationItem.rightBarButtonItem = addButton;
            */
             }

            - (void)viewDidUnload
            {
                [super viewDidUnload];
                // Release any retained subviews of the main view.
            }

            - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
            {
                return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
            }

            /*- (void)insertNewObject:(id)sender
            {
                if (!_objects) {
                    _objects = [[NSMutableArray alloc] init];
                }
                [_objects insertObject:[NSDate date] atIndex:0];
                NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
                [self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
            }
            */
            #pragma mark - Table View

            - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
            {
                return 1;
            }

            - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
            {
                return [self.dataController countOfList];
            }

            - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
            {
                static NSString *CellIdentifier = @"BirdSightingCell";

                static NSDateFormatter *formatter = nil;
                if (formatter == nil)
                {
                    formatter = [[NSDateFormatter alloc] init];
                    [formatter setDateStyle:NSDateFormatterMediumStyle];
                }

                UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
                BirdSighting *sightingAtIndex = [self.dataController objectInListAtIndex:indexPath.row];
                [[cell textLabel] setText:sightingAtIndex.name];
                [[cell detailTextLabel] setText:[formatter stringFromDate:(NSDate *)sightingAtIndex.date]];


                return cell;
            }

            - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
            {
                // Return NO if you do not want the specified item to be editable.
                return NO;
            }

            /*- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
            {
                if (editingStyle == UITableViewCellEditingStyleDelete) {
                    [_objects removeObjectAtIndex:indexPath.row];
                    [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
                } else if (editingStyle == UITableViewCellEditingStyleInsert) {
                    // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
                }
            }
            */
            /*
            // Override to support rearranging the table view.
            - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
            {
            }
            */

            /*
            // Override to support conditional rearranging of the table view.
            - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
            {
                // Return NO if you do not want the item to be re-orderable.
                return YES;
            }
            */

            - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
            {
                if ([[segue identifier] isEqualToString:@"ShowSightingDetails"]) {
                    BirdsDetailViewController *detailViewController = [segue destinationViewController];
                    detailViewController.sighting = [self.dataController objectInListAtIndex:[self.tableView indexPathForSelectedRow].row];

                }
            }

            @end

And here is the code for the BirdsDetailViewController.m

        //
        //  BirdSightingDataController.m
        //  BirdWatching
        //
        //  Created by David Hall on 11/25/12.
        //  Copyright (c) 2012 David Hall. All rights reserved.
        //

        #import "BirdSightingDataController.h"
        #import "BirdSighting.h"

        @interface BirdSightingDataController ()

        - (void)initializeDefaultDataList;

        @end

        @implementation BirdSightingDataController

        - (void)initializeDefaultDataList
        {
            NSMutableArray *sightingList = [[NSMutableArray alloc] init];

            self.masterBirdSightingList = sightingList;

            BirdSighting *sighting;

            NSDate *today = [NSDate date];

            sighting = [[BirdSighting alloc] initWithName:@"Pigeon" location:@"Everywhere" date:today];

            [self addBirdSightingWithSighting:sighting];

        }

        - (void)setMasterBirdSightingList:(NSMutableArray *)newList
        {
            if (_masterBirdSightingList != newList)
            {
                _masterBirdSightingList = [newList mutableCopy];
            }

        }

        - (id)init
        {
            if (self = [super init])
            {
                [self initializeDefaultDataList];

                return self;
            }

            return nil;
        }

        - (NSUInteger)countOfList
        {
            return [self.masterBirdSightingList count];
        }

        - (BirdSighting *)objectInListAtIndex:(NSUInteger)theIndex
        {
            return [self.masterBirdSightingList objectAtIndex:theIndex];
        }

        - (void)addBirdSightingWithSighting:(BirdSighting *)sighting
        {
            [self.masterBirdSightingList addObject:sighting];
        }









        @end

David Hall

  • 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-15T02:30:59+00:00Added an answer on June 15, 2026 at 2:30 am
    1. It’s working when it works. But without knowing more about what you are doing it’s hard to give you an answer.

    2. Highlight the code in the textbox and then click on this button.

      enter image description here

      It will indent the code correctly for you.

    3. I can’t make sense of this question.

    Edited to add

    (After seeing a copy of the project that the OP mailed me)

    Your segue wasn’t wired up properly.

    The segue is supposed to go from the cell to the next view controller, because the point is to transition on a cell click. Your segue is wired up from the controller to the detail view controller. In your project – right click on your view controller and you’ll see the segue is manually connected. But right clicking on the cell doesn’t show a segue connection.

    Delete the current segue and recreate it, this time by control-dragging from the cell to the next view controller. You can then double check the connection by right clicking on the cell and making sure that the segue is connected.

    It should look like:

    enter image description here

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

Sidebar

Related Questions

I am trying to have a textBox auto complete with values from a database.
I'm trying to complete some basic unit tests of some models. However I'm getting
I'm trying to complete an exercise to write a program that takes the following
I am trying to complete the Spring MVC tutorial at: http://static.springsource.org/docs/Spring-MVC-step-by-step/part1.html My problem is
I'm trying to complete a simple word-count program, which keeps track of the number
I am currently trying to complete a transaction for a web based app, however;
I am currently trying to complete a transaction for a web based app, however;
I am trying to complete the tutorial at http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=438 It seems that the servlet
I am trying to complete the upgrade tutorial for Kayako SupportSuite (a ticket/knowledge based
I am trying to complete a tutorial about easymock to use it for 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.