我正在尝试从苹果开发者计划中完成“你的第二个 iOS 应用程序”教程。它是一个基本的 tableView 应用程序。我的问题是应用程序正在成功构建并且没有警告,但是我无法从主视图中获取详细视图。我已经复制并粘贴了 segue 标识符和苹果提供的代码。segue 正在使用 push,我已将其删除并重试了几次。我正在模拟器中测试应用程序。
- 如何判断 segue 是否有效? 
- 每次我将代码从 Xcode 复制/粘贴到堆栈溢出问题文本区域时,我都会在底部收到警告说代码必须缩进 4 个空格???这是否意味着我必须逐行缩进代码?我做了 control + k 并粘贴在突出显示的区域,但是我仍然收到警告?? 
- 运行模拟器并查看它时,我试图通过单击它来使用披露指示器,我是否必须推动一些特殊的东西,例如 control = click 或 command = click 等? 
这是 BirdsMasterViewController.m 文件的代码:
            //
            //  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
这是 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
大卫霍尔

