Created
December 13, 2011 04:00
-
-
Save rhysforyou/1470502 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #import <Foundation/Foundation.h> | |
| #import <CoreData/CoreData.h> | |
| @interface Task : NSManagedObject | |
| @property (nonatomic, retain) NSString * title; | |
| @property (nonatomic, retain) NSNumber * duration; | |
| - (NSString *)durationString; | |
| - (NSString *)minutesString; | |
| @end |
This file contains hidden or 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
| #import "Task.h" | |
| @implementation Task | |
| @dynamic title; | |
| @dynamic duration; | |
| - (NSString *)durationString | |
| { | |
| if ((int)self.duration == 1) { | |
| return @"1 Pomodoro"; | |
| } else { | |
| return [NSString stringWithFormat:@"%@ Pomodoros", self.duration]; | |
| } | |
| } | |
| - (NSString *)minutesString | |
| { | |
| return [NSString stringWithFormat:@"%@ minutes", [NSNumber numberWithInt:(int)self.duration*25]]; | |
| } | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment