Created
July 22, 2010 00:10
-
-
Save mraichelson/485362 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Answers.m | |
// Answers | |
// | |
// Created by Michael Raichelson on 7/21/10. | |
// Copyright 2010 Pixis Creative. All rights reserved. | |
// | |
#import "Answers.h" | |
@implementation Answers | |
@synthesize answers; | |
-(NSMutableArray *) answers { // overrides the synthesized getter | |
if (!answers) { | |
self.answers = [NSMutableArray arrayWithObjects: | |
@"Oh yeah, big time!", | |
@"Not f'n likely!", | |
@"How would I know?", | |
@"Weasels?", | |
@"Let's have a meeting!", | |
nil | |
]; | |
} | |
return answers; | |
} | |
-(NSUInteger)count { | |
return [self.answers count]; | |
} | |
-(NSString *)answerAtIndex:(NSUInteger)theIndex { | |
return [self.answers objectAtIndex:theIndex]; | |
} | |
-(void)removeAnswerAtIndex:(NSUInteger)theIndex { | |
[self.answers removeObjectAtIndex:theIndex]; | |
} | |
-(void)addAnswer:(NSString *)theAnswer { | |
[self.answers insertObject:theAnswer atIndex:0]; | |
} | |
-(void)dealloc { | |
[answers release]; | |
[super dealloc]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment