0

I have been trying to follow along with the tutorial on Apple's developer website: https://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/SecondiOSAppTutorial/Introduction/Introduction.html but cannot figure out why my project will not run. I have one warning: Incomplete implementation in the BirdSightingDataController.m file:

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

@interface BirdSightingDataController ()
- (void)initializeDefaultDataList;
@end

@implementation BirdSightingDataController

@synthesize masterBirdSightingList = _masterBirdSightingList;

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

    self.masterBirdSightingList = sightingList;

    [self addBirdSightingWithName:@"Pigeon" location:@"Everywhere"];
}

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

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


    return self;

}

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

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

- (void)addBirdSightingWithName:(NSString *)inputBirdName location:(NSString *)inputLocation
{
    BirdSighting *sighting;

    NSDate *today = [NSDate date];

    sighting = [[BirdSighting alloc] initWithName:inputBirdName location:inputLocation 
                                                 date:today];
    [self.masterBirdSightingList addObject:sighting];
}
@end
1
Contributor
1
Reply
3
Views
4 Years
Discussion Span
Last Post by Dane2259
0

For some reason it doesn't like the private method initalizeDefaultDataList (on line 33) that was declared in the interface above the implementation declaration.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.