From 649092d37eceb4eb7c6e038c07e17166e99bee67 Mon Sep 17 00:00:00 2001 From: Charles Kang Date: Sat, 27 Jun 2015 11:59:14 -0400 Subject: [PATCH 01/19] changed readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 082e4ed..86a4202 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,6 @@ All directions are here... https://github.com/accesscode-2-2/unit-0/tree/master/project Instructions on forking and pull requests here... https://github.com/accesscode-2-2/how-to-pr + + +Hey Brian \ No newline at end of file From d8989160613ac84c899d1a920f2841e09645ed10 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 27 Jun 2015 12:03:37 -0400 Subject: [PATCH 02/19] updated readme --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 86a4202..14a8a97 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,6 @@ https://github.com/accesscode-2-2/unit-0/tree/master/project Instructions on forking and pull requests here... https://github.com/accesscode-2-2/how-to-pr -Hey Brian \ No newline at end of file +Hey Brian + +lulz \ No newline at end of file From 92a436116d0516c51581cc9f2130a5030840d153 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 27 Jun 2015 14:24:54 -0400 Subject: [PATCH 03/19] 2nd update --- TodoList/TodoList/main.m | 55 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/TodoList/TodoList/main.m b/TodoList/TodoList/main.m index 187be40..bb5ffea 100644 --- a/TodoList/TodoList/main.m +++ b/TodoList/TodoList/main.m @@ -8,10 +8,61 @@ #import +@interface toDoList: NSObject + +-(void) enterUserList: (NSMutableArray * )userList; +-(NSArray *)userList; +-(void) manageList: (NSArray *)manList; +-(NSArray *)manList; +-(void) representList: (NSArray *)repList; +-(NSArray *)repList; +-(void) representItem: (NSString *)repItem; +-(NSString *)repItem; + +@end + +@implementation toDoList { + NSMutableArray *_userList; + NSArray *_manList; + NSArray *_repList; + NSString *_repItem; +} + +-(void) enterUserList: (NSMutableArray *)userList { + _userList = userList; +} + +-(void) manageList:(NSArray *)manList { + _manList = manList; +} + +-(void) representList: (NSArray *)repList { + _repList = repList; +} + +-(void) representItem: (NSString *)repItem { + _repItem = repItem; +} + + + + +@end + int main(int argc, const char * argv[]) { @autoreleasepool { - // insert code here... - NSLog(@"Hello, World!"); + + toDoList *Charles = [[toDoList alloc]init]; + NSMutableArray *charlesList = [[NSMutableArray alloc]init]; + NSLog(@"Good Morning, what are you going to do today?"); + + scanf(@"%@, %@, %@, %@\n", &item1, &item2, &item, &item4); + *charlesList = [Charles userList:[NSMutableArray arrayWithObjects:@"item1", @"item2", @"item3", @"item4", nil]]; + + + + + } return 0; } From 423789ef60684514ea14921345f602e3065a836f Mon Sep 17 00:00:00 2001 From: Charles Kang Date: Sat, 27 Jun 2015 15:04:45 -0400 Subject: [PATCH 04/19] tried implementing --- TodoList/TodoList/main.m | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/TodoList/TodoList/main.m b/TodoList/TodoList/main.m index bb5ffea..0ba568d 100644 --- a/TodoList/TodoList/main.m +++ b/TodoList/TodoList/main.m @@ -26,6 +26,7 @@ @implementation toDoList { NSArray *_manList; NSArray *_repList; NSString *_repItem; + } -(void) enterUserList: (NSMutableArray *)userList { @@ -54,15 +55,44 @@ int main(int argc, const char * argv[]) { toDoList *Charles = [[toDoList alloc]init]; NSMutableArray *charlesList = [[NSMutableArray alloc]init]; - NSLog(@"Good Morning, what are you going to do today?"); + int laundry; + int homework; + int shopping; + int exercise; + NSLog(@"Good morning, what are you going to do today?\n 1) Laundry\n 2) Homework\n 3) Shopping\n 4) Exercise\n", laundry, homework, shopping, exercise); + scanf("%d", &laundry, &homework, &shopping, &exercise); + +// if (laundry == 1) { +// NSLog(@"Choose another chore\n"); +// +// } else if (homework == 2) { +// NSLog(@"You need to do more! Choose another one!"); +// } else if (shopping == 3) { +// NSLog(@"Anything else?"); +// } else if (exercise == 4) { +// NSLog(@"Great, now we're set for the day"); +// } + + for (int chores; chores <=4 ; chores++) { + if (laundry == 1) { + NSLog(@"Choose another chore\n"); + } else if (homework == 2) { + NSLog(@"You need to do more! Choose another one!"); + } else if (shopping == 3) { + NSLog(@"Anything else?"); + } else if (exercise == 4) { + NSLog(@"Great, now we're set for the day"); + } + + + + - scanf(@"%@, %@, %@, %@\n", &item1, &item2, &item, &item4); - *charlesList = [Charles userList:[NSMutableArray arrayWithObjects:@"item1", @"item2", @"item3", @"item4", nil]]; - } return 0; } +} From 43db804d814d9ed9eccdef8ff9c1d84d5dd8c4ab Mon Sep 17 00:00:00 2001 From: Charles Kang Date: Sat, 27 Jun 2015 16:58:17 -0400 Subject: [PATCH 05/19] broke the wall --- TodoList/TodoList/main.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TodoList/TodoList/main.m b/TodoList/TodoList/main.m index 0ba568d..517bff8 100644 --- a/TodoList/TodoList/main.m +++ b/TodoList/TodoList/main.m @@ -5,7 +5,7 @@ // Created by Michael Kavouras on 6/25/15. // Copyright (c) 2015 Mike Kavouras. All rights reserved. // - +// delete this add #import @interface toDoList: NSObject @@ -86,7 +86,7 @@ int main(int argc, const char * argv[]) { - + From e15f4f22c725968299610042758f5dd33dd607b6 Mon Sep 17 00:00:00 2001 From: Charles Kang Date: Sat, 27 Jun 2015 17:23:41 -0400 Subject: [PATCH 06/19] recovered mistakes --- TodoList/TodoList/main.m | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/TodoList/TodoList/main.m b/TodoList/TodoList/main.m index 517bff8..c545d94 100644 --- a/TodoList/TodoList/main.m +++ b/TodoList/TodoList/main.m @@ -59,29 +59,22 @@ int main(int argc, const char * argv[]) { int homework; int shopping; int exercise; - NSLog(@"Good morning, what are you going to do today?\n 1) Laundry\n 2) Homework\n 3) Shopping\n 4) Exercise\n", laundry, homework, shopping, exercise); - scanf("%d", &laundry, &homework, &shopping, &exercise); + int chore; + + NSLog(@"Good morning, what are you going to do today?\n 1) Laundry\n 2) Homework\n 3) Shopping\n 4) Exercise\n"); + -// if (laundry == 1) { -// NSLog(@"Choose another chore\n"); -// -// } else if (homework == 2) { -// NSLog(@"You need to do more! Choose another one!"); -// } else if (shopping == 3) { -// NSLog(@"Anything else?"); -// } else if (exercise == 4) { -// NSLog(@"Great, now we're set for the day"); -// } - for (int chores; chores <=4 ; chores++) { - if (laundry == 1) { - NSLog(@"Choose another chore\n"); - } else if (homework == 2) { - NSLog(@"You need to do more! Choose another one!"); - } else if (shopping == 3) { - NSLog(@"Anything else?"); - } else if (exercise == 4) { - NSLog(@"Great, now we're set for the day"); + for (int tasks; tasks <=4 ; tasks++) { + scanf("%d", &chore); + if (chore == 1) { + NSLog(@"Choose another chore\n", chore); + } else if (chore == 2) { + NSLog(@"You need to do more! Choose another one!", chore); + } else if (chore == 3) { + NSLog(@"Anything else?", chore); + } else if (chore == 4) { + NSLog(@"Great, now we're set for the day", chore); } From a3890e6124b814fd7cc863c6a31ff51c7493e1ce Mon Sep 17 00:00:00 2001 From: Charles Kang Date: Sat, 27 Jun 2015 22:18:10 -0400 Subject: [PATCH 07/19] added separate folders for organization --- TodoList/TodoList.xcodeproj/project.pbxproj | 19 ++++++++++++++ TodoList/TodoList/List.h | 13 ++++++++++ TodoList/TodoList/List.m | 13 ++++++++++ TodoList/TodoList/ListItem.h | 13 ++++++++++ TodoList/TodoList/ListItem.m | 13 ++++++++++ TodoList/TodoList/ListManager.h | 22 ++++++++++++++++ TodoList/TodoList/ListManager.m | 18 +++++++++++++ TodoList/TodoList/main.m | 28 ++++++++++----------- 8 files changed, 125 insertions(+), 14 deletions(-) create mode 100644 TodoList/TodoList/List.h create mode 100644 TodoList/TodoList/List.m create mode 100644 TodoList/TodoList/ListItem.h create mode 100644 TodoList/TodoList/ListItem.m create mode 100644 TodoList/TodoList/ListManager.h create mode 100644 TodoList/TodoList/ListManager.m diff --git a/TodoList/TodoList.xcodeproj/project.pbxproj b/TodoList/TodoList.xcodeproj/project.pbxproj index 17baea5..a8ba19c 100644 --- a/TodoList/TodoList.xcodeproj/project.pbxproj +++ b/TodoList/TodoList.xcodeproj/project.pbxproj @@ -8,6 +8,9 @@ /* Begin PBXBuildFile section */ 8D9789F71B3C9A7F007CF4CF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D9789F61B3C9A7F007CF4CF /* main.m */; }; + BF668D5F1B3F8DBC0047500D /* ListManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BF668D5E1B3F8DBC0047500D /* ListManager.m */; }; + BF668D621B3F90050047500D /* List.m in Sources */ = {isa = PBXBuildFile; fileRef = BF668D611B3F90050047500D /* List.m */; }; + BF668D651B3F90150047500D /* ListItem.m in Sources */ = {isa = PBXBuildFile; fileRef = BF668D641B3F90150047500D /* ListItem.m */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -25,6 +28,12 @@ /* Begin PBXFileReference section */ 8D9789F31B3C9A7F007CF4CF /* TodoList */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TodoList; sourceTree = BUILT_PRODUCTS_DIR; }; 8D9789F61B3C9A7F007CF4CF /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + BF668D5D1B3F8DBC0047500D /* ListManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListManager.h; sourceTree = ""; }; + BF668D5E1B3F8DBC0047500D /* ListManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListManager.m; sourceTree = ""; }; + BF668D601B3F90050047500D /* List.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = List.h; sourceTree = ""; }; + BF668D611B3F90050047500D /* List.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = List.m; sourceTree = ""; }; + BF668D631B3F90150047500D /* ListItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListItem.h; sourceTree = ""; }; + BF668D641B3F90150047500D /* ListItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListItem.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -58,6 +67,12 @@ isa = PBXGroup; children = ( 8D9789F61B3C9A7F007CF4CF /* main.m */, + BF668D5D1B3F8DBC0047500D /* ListManager.h */, + BF668D5E1B3F8DBC0047500D /* ListManager.m */, + BF668D601B3F90050047500D /* List.h */, + BF668D611B3F90050047500D /* List.m */, + BF668D631B3F90150047500D /* ListItem.h */, + BF668D641B3F90150047500D /* ListItem.m */, ); path = TodoList; sourceTree = ""; @@ -118,7 +133,10 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + BF668D651B3F90150047500D /* ListItem.m in Sources */, + BF668D621B3F90050047500D /* List.m in Sources */, 8D9789F71B3C9A7F007CF4CF /* main.m in Sources */, + BF668D5F1B3F8DBC0047500D /* ListManager.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -235,6 +253,7 @@ 8D9789FC1B3C9A7F007CF4CF /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/TodoList/TodoList/List.h b/TodoList/TodoList/List.h new file mode 100644 index 0000000..7836945 --- /dev/null +++ b/TodoList/TodoList/List.h @@ -0,0 +1,13 @@ +// +// List.h +// TodoList +// +// Created by Charles Kang on 6/27/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import + +@interface List : NSObject + +@end diff --git a/TodoList/TodoList/List.m b/TodoList/TodoList/List.m new file mode 100644 index 0000000..981f932 --- /dev/null +++ b/TodoList/TodoList/List.m @@ -0,0 +1,13 @@ +// +// List.m +// TodoList +// +// Created by Charles Kang on 6/27/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "List.h" + +@implementation List + +@end diff --git a/TodoList/TodoList/ListItem.h b/TodoList/TodoList/ListItem.h new file mode 100644 index 0000000..870c4e2 --- /dev/null +++ b/TodoList/TodoList/ListItem.h @@ -0,0 +1,13 @@ +// +// ListItem.h +// TodoList +// +// Created by Charles Kang on 6/27/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import + +@interface ListItem : NSObject + +@end diff --git a/TodoList/TodoList/ListItem.m b/TodoList/TodoList/ListItem.m new file mode 100644 index 0000000..4f44116 --- /dev/null +++ b/TodoList/TodoList/ListItem.m @@ -0,0 +1,13 @@ +// +// ListItem.m +// TodoList +// +// Created by Charles Kang on 6/27/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "ListItem.h" + +@implementation ListItem + +@end diff --git a/TodoList/TodoList/ListManager.h b/TodoList/TodoList/ListManager.h new file mode 100644 index 0000000..e37bb93 --- /dev/null +++ b/TodoList/TodoList/ListManager.h @@ -0,0 +1,22 @@ +// +// ListManager.h +// TodoList +// +// Created by Charles Kang on 6/27/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import + +@interface ListManager : NSObject + +-(void) printCommand; +-(void) createList; +-(void) addList; +-(void) deleteList; +-(void) printLists; +-(void) editItem; +-(void) itemDone; + +@end + diff --git a/TodoList/TodoList/ListManager.m b/TodoList/TodoList/ListManager.m new file mode 100644 index 0000000..8917946 --- /dev/null +++ b/TodoList/TodoList/ListManager.m @@ -0,0 +1,18 @@ +// +// ListManager.m +// TodoList +// +// Created by Charles Kang on 6/27/15. +// Copyright (c) 2015 Mike Kavouras. All rights reserved. +// + +#import "ListManager.h" + +@implementation ListManager + +-(void) printCommand { + + +} + +@end diff --git a/TodoList/TodoList/main.m b/TodoList/TodoList/main.m index c545d94..a42d1b8 100644 --- a/TodoList/TodoList/main.m +++ b/TodoList/TodoList/main.m @@ -61,21 +61,21 @@ int main(int argc, const char * argv[]) { int exercise; int chore; - NSLog(@"Good morning, what are you going to do today?\n 1) Laundry\n 2) Homework\n 3) Shopping\n 4) Exercise\n"); + NSLog(@"What's on the to-do list?\n"); - - for (int tasks; tasks <=4 ; tasks++) { - scanf("%d", &chore); - if (chore == 1) { - NSLog(@"Choose another chore\n", chore); - } else if (chore == 2) { - NSLog(@"You need to do more! Choose another one!", chore); - } else if (chore == 3) { - NSLog(@"Anything else?", chore); - } else if (chore == 4) { - NSLog(@"Great, now we're set for the day", chore); - } + +// for (int tasks; tasks <=4 ; tasks++) { +// scanf("%d", &chore); +// if (chore == 1) { +// NSLog(@"Choose another chore\n", chore); +// } else if (chore == 2) { +// NSLog(@"You need to do more! Choose another one!", chore); +// } else if (chore == 3) { +// NSLog(@"Anything else?", chore); +// } else if (chore == 4) { +// NSLog(@"Great, now we're set for the day", chore); +// } @@ -88,4 +88,4 @@ int main(int argc, const char * argv[]) { } return 0; } -} + From 9cc19a3ddb90c4f732df7ae8363d51c2251611b8 Mon Sep 17 00:00:00 2001 From: Charles Kang Date: Sun, 28 Jun 2015 10:48:12 -0400 Subject: [PATCH 08/19] made changes --- TodoList/TodoList/List.h | 2 ++ TodoList/TodoList/List.m | 4 +++- TodoList/TodoList/ListItem.h | 2 ++ TodoList/TodoList/ListManager.h | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/TodoList/TodoList/List.h b/TodoList/TodoList/List.h index 7836945..1faa78d 100644 --- a/TodoList/TodoList/List.h +++ b/TodoList/TodoList/List.h @@ -8,6 +8,8 @@ #import + + @interface List : NSObject @end diff --git a/TodoList/TodoList/List.m b/TodoList/TodoList/List.m index 981f932..93d2bd6 100644 --- a/TodoList/TodoList/List.m +++ b/TodoList/TodoList/List.m @@ -8,6 +8,8 @@ #import "List.h" -@implementation List + + +@implementation list : NSObject ; @end diff --git a/TodoList/TodoList/ListItem.h b/TodoList/TodoList/ListItem.h index 870c4e2..26e968c 100644 --- a/TodoList/TodoList/ListItem.h +++ b/TodoList/TodoList/ListItem.h @@ -8,6 +8,8 @@ #import +@class listItem; + @interface ListItem : NSObject @end diff --git a/TodoList/TodoList/ListManager.h b/TodoList/TodoList/ListManager.h index e37bb93..570fc0d 100644 --- a/TodoList/TodoList/ListManager.h +++ b/TodoList/TodoList/ListManager.h @@ -8,6 +8,8 @@ #import +@class listManager; + @interface ListManager : NSObject -(void) printCommand; From 15195f2b8b937bdce99f73efda31326582bacb36 Mon Sep 17 00:00:00 2001 From: Charles Kang Date: Sun, 28 Jun 2015 10:56:44 -0400 Subject: [PATCH 09/19] fixed stuff --- TodoList/TodoList/List.h | 14 +++++++++++++- TodoList/TodoList/ListManager.h | 7 ++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/TodoList/TodoList/List.h b/TodoList/TodoList/List.h index 1faa78d..657c6cc 100644 --- a/TodoList/TodoList/List.h +++ b/TodoList/TodoList/List.h @@ -8,8 +8,20 @@ #import - +@class listItem; @interface List : NSObject +@property (nonatomic) NSString *listName; + +-(instancetype) initWithName:(NSString *) name; + +-(void) printCommand; +-(void) createList; +-(void) addList; +-(void) deleteList; +-(void) printLists; +-(void) editItem; +-(void) markDone; + @end diff --git a/TodoList/TodoList/ListManager.h b/TodoList/TodoList/ListManager.h index 570fc0d..76fb9e8 100644 --- a/TodoList/TodoList/ListManager.h +++ b/TodoList/TodoList/ListManager.h @@ -15,10 +15,11 @@ -(void) printCommand; -(void) createList; -(void) addList; --(void) deleteList; +-(void) deleteList: (int) index; +-(void) editItem: (int) index; +-(void) markDone: (int) index; -(void) printLists; --(void) editItem; --(void) itemDone; + @end From ed189531c5395ddb5fcbe013548384043b3595fc Mon Sep 17 00:00:00 2001 From: Charles Kang Date: Sun, 28 Jun 2015 11:45:09 -0400 Subject: [PATCH 10/19] making progress --- TodoList/TodoList.xcodeproj/project.pbxproj | 2 +- TodoList/TodoList/List.h | 10 +++-- TodoList/TodoList/List.m | 2 +- TodoList/TodoList/ListItem.h | 7 +++- TodoList/TodoList/ListManager.h | 7 +++- TodoList/TodoList/main.m | 46 ++++++--------------- 6 files changed, 34 insertions(+), 40 deletions(-) diff --git a/TodoList/TodoList.xcodeproj/project.pbxproj b/TodoList/TodoList.xcodeproj/project.pbxproj index a8ba19c..23822c5 100644 --- a/TodoList/TodoList.xcodeproj/project.pbxproj +++ b/TodoList/TodoList.xcodeproj/project.pbxproj @@ -66,13 +66,13 @@ 8D9789F51B3C9A7F007CF4CF /* TodoList */ = { isa = PBXGroup; children = ( - 8D9789F61B3C9A7F007CF4CF /* main.m */, BF668D5D1B3F8DBC0047500D /* ListManager.h */, BF668D5E1B3F8DBC0047500D /* ListManager.m */, BF668D601B3F90050047500D /* List.h */, BF668D611B3F90050047500D /* List.m */, BF668D631B3F90150047500D /* ListItem.h */, BF668D641B3F90150047500D /* ListItem.m */, + 8D9789F61B3C9A7F007CF4CF /* main.m */, ); path = TodoList; sourceTree = ""; diff --git a/TodoList/TodoList/List.h b/TodoList/TodoList/List.h index 657c6cc..46706c3 100644 --- a/TodoList/TodoList/List.h +++ b/TodoList/TodoList/List.h @@ -19,9 +19,13 @@ -(void) printCommand; -(void) createList; -(void) addList; --(void) deleteList; +-(void) deleteList: (int) index; +-(void) editItem: (int) index; +-(void) markDone: (int) index; -(void) printLists; --(void) editItem; --(void) markDone; +-(void) go; +-(void) active; +-(void) inactive; + @end diff --git a/TodoList/TodoList/List.m b/TodoList/TodoList/List.m index 93d2bd6..e16caf3 100644 --- a/TodoList/TodoList/List.m +++ b/TodoList/TodoList/List.m @@ -10,6 +10,6 @@ -@implementation list : NSObject ; +@implementation List : NSObject ; @end diff --git a/TodoList/TodoList/ListItem.h b/TodoList/TodoList/ListItem.h index 26e968c..1d1fb16 100644 --- a/TodoList/TodoList/ListItem.h +++ b/TodoList/TodoList/ListItem.h @@ -8,8 +8,13 @@ #import -@class listItem; @interface ListItem : NSObject +-(instancetype): initWithDefaultAndName :(NSString *) name; + +@property (nonatomic) NSInteger priority; +@property (nonatomic) NSString *itemName; +@property (nonatomic) BOOL finished; + @end diff --git a/TodoList/TodoList/ListManager.h b/TodoList/TodoList/ListManager.h index 76fb9e8..c1a8564 100644 --- a/TodoList/TodoList/ListManager.h +++ b/TodoList/TodoList/ListManager.h @@ -7,18 +7,23 @@ // #import +#import "ListManager.h" +#import "List.h" +#import "ListItem.h" @class listManager; @interface ListManager : NSObject -(void) printCommand; --(void) createList; -(void) addList; -(void) deleteList: (int) index; -(void) editItem: (int) index; -(void) markDone: (int) index; -(void) printLists; +-(void) priority; +-(void) active; +-(void) inactive; @end diff --git a/TodoList/TodoList/main.m b/TodoList/TodoList/main.m index a42d1b8..dff0766 100644 --- a/TodoList/TodoList/main.m +++ b/TodoList/TodoList/main.m @@ -10,6 +10,8 @@ @interface toDoList: NSObject + + -(void) enterUserList: (NSMutableArray * )userList; -(NSArray *)userList; -(void) manageList: (NSArray *)manList; @@ -45,47 +47,25 @@ -(void) representItem: (NSString *)repItem { _repItem = repItem; } - - - @end int main(int argc, const char * argv[]) { @autoreleasepool { - toDoList *Charles = [[toDoList alloc]init]; - NSMutableArray *charlesList = [[NSMutableArray alloc]init]; - int laundry; - int homework; - int shopping; - int exercise; - int chore; - - NSLog(@"What's on the to-do list?\n"); - - - -// for (int tasks; tasks <=4 ; tasks++) { -// scanf("%d", &chore); -// if (chore == 1) { -// NSLog(@"Choose another chore\n", chore); -// } else if (chore == 2) { -// NSLog(@"You need to do more! Choose another one!", chore); -// } else if (chore == 3) { -// NSLog(@"Anything else?", chore); -// } else if (chore == 4) { -// NSLog(@"Great, now we're set for the day", chore); -// } - - - - - - + printf("To-Do List App\n\n\n"); + + char addList, deleteList, editItem, markDone, priority, active, inactive, createList; + int opt1, opt2, opt3, opt4, opt5, opt6; + + printf("\n1) Add Item\n2) Delete Item\n3) Edit Item\n4) Mark Done\n5) Active \n6) Inactive"); + scanf("%s", &createList); + for (int options = 0; options <=6; options++) { + scanf("%d", &opt1 + } + } return 0; } - From 1156def80fc967842cee047c6d8fb29a657e1302 Mon Sep 17 00:00:00 2001 From: Charles Kang Date: Sun, 28 Jun 2015 11:50:56 -0400 Subject: [PATCH 11/19] made it pretty --- TodoList/TodoList/main.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/TodoList/TodoList/main.m b/TodoList/TodoList/main.m index dff0766..d2b1ef2 100644 --- a/TodoList/TodoList/main.m +++ b/TodoList/TodoList/main.m @@ -54,14 +54,14 @@ int main(int argc, const char * argv[]) { printf("To-Do List App\n\n\n"); - char addList, deleteList, editItem, markDone, priority, active, inactive, createList; + char addList, deleteList, editItem, markDone, priority, active, createList; int opt1, opt2, opt3, opt4, opt5, opt6; - printf("\n1) Add Item\n2) Delete Item\n3) Edit Item\n4) Mark Done\n5) Active \n6) Inactive"); + printf("\na) Add Item\n\nd) Delete Item\n\ne) Edit Item\n\nm) Mark Item Done\n\ns) Show Active List\n"); scanf("%s", &createList); for (int options = 0; options <=6; options++) { - scanf("%d", &opt1 - } + scanf("%d", &opt1); + @@ -69,3 +69,4 @@ int main(int argc, const char * argv[]) { } return 0; } +} From c0cfa501d5dbe48a17281a2da9617b60d8fc3803 Mon Sep 17 00:00:00 2001 From: Brian Date: Sun, 28 Jun 2015 12:33:16 -0400 Subject: [PATCH 12/19] added while loop --- TodoList/TodoList/main.m | 148 ++++++++++++++++++++++++++------------- 1 file changed, 98 insertions(+), 50 deletions(-) diff --git a/TodoList/TodoList/main.m b/TodoList/TodoList/main.m index d2b1ef2..cf65ecb 100644 --- a/TodoList/TodoList/main.m +++ b/TodoList/TodoList/main.m @@ -8,65 +8,113 @@ // delete this add #import -@interface toDoList: NSObject - - - --(void) enterUserList: (NSMutableArray * )userList; --(NSArray *)userList; --(void) manageList: (NSArray *)manList; --(NSArray *)manList; --(void) representList: (NSArray *)repList; --(NSArray *)repList; --(void) representItem: (NSString *)repItem; --(NSString *)repItem; - -@end - -@implementation toDoList { - NSMutableArray *_userList; - NSArray *_manList; - NSArray *_repList; - NSString *_repItem; - -} - --(void) enterUserList: (NSMutableArray *)userList { - _userList = userList; -} - --(void) manageList:(NSArray *)manList { - _manList = manList; -} - --(void) representList: (NSArray *)repList { - _repList = repList; -} - --(void) representItem: (NSString *)repItem { - _repItem = repItem; -} - -@end +//@interface toDoList: NSObject +// +// +// +//-(void) enterUserList: (NSMutableArray * )userList; +//-(NSArray *)userList; +//-(void) manageList: (NSArray *)manList; +//-(NSArray *)manList; +//-(void) representList: (NSArray *)repList; +//-(NSArray *)repList; +//-(void) representItem: (NSString *)repItem; +//-(NSString *)repItem; +// +//@end +// +//@implementation toDoList { +// NSMutableArray *_userList; +// NSArray *_manList; +// NSArray *_repList; +// NSString *_repItem; +// +//} +// +//-(void) enterUserList: (NSMutableArray *)userList { +// _userList = userList; +//} +// +//-(void) manageList:(NSArray *)manList { +// _manList = manList; +//} +// +//-(void) representList: (NSArray *)repList { +// _repList = repList; +//} +// +//-(void) representItem: (NSString *)repItem { +// _repItem = repItem; +//} +// +//@end int main(int argc, const char * argv[]) { @autoreleasepool { printf("To-Do List App\n\n\n"); - char addList, deleteList, editItem, markDone, priority, active, createList; - int opt1, opt2, opt3, opt4, opt5, opt6; - - printf("\na) Add Item\n\nd) Delete Item\n\ne) Edit Item\n\nm) Mark Item Done\n\ns) Show Active List\n"); - scanf("%s", &createList); - for (int options = 0; options <=6; options++) { - scanf("%d", &opt1); - +// char addList, deleteList, editItem, markDone, priority, active, createList; + + printf("1) Add Item\n\n2) Delete Item\n\n3) Edit Item\n\n4) Mark Item Done\n\n5) Show Active List\n"); + char opt; + int tasks = 0; - + while (tasks <=1000) + { + tasks++; + + scanf("%c", &opt); + fpurge(stdin); + + if (opt == 'a') { + + NSLog(@"What would you like to add?\n", opt); + + } else if (opt == 'b') { + + NSLog(@"Delete which task?", opt); + + } else if (opt == 'c') { + + NSLog(@"What would you like to edit?", opt); + + } else if (opt == 'd') { + + NSLog(@"blank is done", opt); + + } else if (opt == 'e') { + + NSLog(@"This is your current list: ", opt); + } +// for (int tasks = 0; tasks <=4 ; tasks++) { +// +// scanf("%d", &opt); +// fpurge(stdin); +// +// if (opt == 1) { +// +// NSLog(@"What would you like to add?\n", opt); +// +// } else if (opt == 2) { +// +// NSLog(@"Delete which task?", opt); +// +// } else if (opt == 3) { +// +// NSLog(@"What would you like to edit?", opt); +// +// } else if (opt == 4) { +// +// NSLog(@"blank is done", opt); +// +// } else if (opt == 5) { +// +// NSLog(@"This is your current list: ", opt); +// } + } } return 0; } -} From abd6750d5ef184a49af8f67afcd368e2a7ec6fc0 Mon Sep 17 00:00:00 2001 From: Charles Kang Date: Sun, 28 Jun 2015 14:15:09 -0400 Subject: [PATCH 13/19] made changes --- TodoList/TodoList/main.m | 131 ++++++++++++++------------------------- 1 file changed, 46 insertions(+), 85 deletions(-) diff --git a/TodoList/TodoList/main.m b/TodoList/TodoList/main.m index cf65ecb..f7e84c3 100644 --- a/TodoList/TodoList/main.m +++ b/TodoList/TodoList/main.m @@ -8,113 +8,74 @@ // delete this add #import -//@interface toDoList: NSObject -// -// -// -//-(void) enterUserList: (NSMutableArray * )userList; -//-(NSArray *)userList; -//-(void) manageList: (NSArray *)manList; -//-(NSArray *)manList; -//-(void) representList: (NSArray *)repList; -//-(NSArray *)repList; -//-(void) representItem: (NSString *)repItem; -//-(NSString *)repItem; -// -//@end -// -//@implementation toDoList { -// NSMutableArray *_userList; -// NSArray *_manList; -// NSArray *_repList; -// NSString *_repItem; -// -//} -// -//-(void) enterUserList: (NSMutableArray *)userList { -// _userList = userList; -//} -// -//-(void) manageList:(NSArray *)manList { -// _manList = manList; -//} -// -//-(void) representList: (NSArray *)repList { -// _repList = repList; -//} -// -//-(void) representItem: (NSString *)repItem { -// _repItem = repItem; -//} -// -//@end +@interface toDoList: NSObject +-(void) listItems : (NSMutableArray *) items; +-(NSMutableArray *) items; + + +@end + +@implementation toDoList { + NSMutableArray *_items; +} + + -(void) listItems : (NSMutableArray *) items{ + _items = items; + } + + + +@end int main(int argc, const char * argv[]) { @autoreleasepool { - printf("To-Do List App\n\n\n"); - -// char addList, deleteList, editItem, markDone, priority, active, createList; - - printf("1) Add Item\n\n2) Delete Item\n\n3) Edit Item\n\n4) Mark Item Done\n\n5) Show Active List\n"); + + + } + printf("To-Do List App\n\n\n"); - char opt; + + + printf("a) Add Item\n\nb) Delete Item\n\nc) Edit Item\n\nd) Mark Item Done\n\ne) Show Active List\n"); + char option; int tasks = 0; while (tasks <=1000) { tasks++; - scanf("%c", &opt); + scanf("%c", &option); fpurge(stdin); - if (opt == 'a') { + if (option == 'a') { - NSLog(@"What would you like to add?\n", opt); + NSLog(@"What would you like to add?\n", option); + scanf("\n", &items); - } else if (opt == 'b') { + } else if (option == 'b') { - NSLog(@"Delete which task?", opt); + NSLog(@"Delete which task?", option); - } else if (opt == 'c') { + } else if (option == 'c') { - NSLog(@"What would you like to edit?", opt); + NSLog(@"What would you like to edit?", option); - } else if (opt == 'd') { + } else if (option == 'd') { - NSLog(@"blank is done", opt); + NSLog(@"blank is done", option); - } else if (opt == 'e') { + } else if (option == 'e') { - NSLog(@"This is your current list: ", opt); + NSLog(@"This is your current list: ", option); } -// for (int tasks = 0; tasks <=4 ; tasks++) { -// -// scanf("%d", &opt); -// fpurge(stdin); -// -// if (opt == 1) { -// -// NSLog(@"What would you like to add?\n", opt); -// -// } else if (opt == 2) { -// -// NSLog(@"Delete which task?", opt); -// -// } else if (opt == 3) { -// -// NSLog(@"What would you like to edit?", opt); -// -// } else if (opt == 4) { -// -// NSLog(@"blank is done", opt); -// -// } else if (opt == 5) { -// -// NSLog(@"This is your current list: ", opt); -// } - } + } + return 0; } - return 0; -} + + + + + + From 7ce73aa6e9e59921193a5b0382626376fe434a29 Mon Sep 17 00:00:00 2001 From: Charles Kang Date: Sun, 28 Jun 2015 14:49:13 -0400 Subject: [PATCH 14/19] help --- TodoList/TodoList/ListItem.m | 14 ++++++++++++++ TodoList/TodoList/ListManager.h | 2 -- TodoList/TodoList/main.m | 5 ++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/TodoList/TodoList/ListItem.m b/TodoList/TodoList/ListItem.m index 4f44116..45ca631 100644 --- a/TodoList/TodoList/ListItem.m +++ b/TodoList/TodoList/ListItem.m @@ -6,8 +6,22 @@ // Copyright (c) 2015 Mike Kavouras. All rights reserved. // + #import "ListItem.h" @implementation ListItem +- (instancetype) initWithDefaultAndName:(NSString *)name{ + + if(self = [super init]){ + self.priority = 1; + self.finished = NO; + self.itemName = name; + + return self; + } + return nil; +} + + @end diff --git a/TodoList/TodoList/ListManager.h b/TodoList/TodoList/ListManager.h index c1a8564..3153b45 100644 --- a/TodoList/TodoList/ListManager.h +++ b/TodoList/TodoList/ListManager.h @@ -11,8 +11,6 @@ #import "List.h" #import "ListItem.h" -@class listManager; - @interface ListManager : NSObject -(void) printCommand; diff --git a/TodoList/TodoList/main.m b/TodoList/TodoList/main.m index f7e84c3..ac90440 100644 --- a/TodoList/TodoList/main.m +++ b/TodoList/TodoList/main.m @@ -52,7 +52,7 @@ int main(int argc, const char * argv[]) { if (option == 'a') { NSLog(@"What would you like to add?\n", option); - scanf("\n", &items); + } else if (option == 'b') { @@ -70,6 +70,9 @@ int main(int argc, const char * argv[]) { NSLog(@"This is your current list: ", option); } + else if (option !='a,b,c,d,e') { + NSLog(@"Invalid", option); + } } return 0; } From 0c2176b209c3e130d81e83309f2a576b1bc8d270 Mon Sep 17 00:00:00 2001 From: Charles Kang Date: Sun, 28 Jun 2015 15:32:58 -0400 Subject: [PATCH 15/19] added quit break --- TodoList/TodoList/main.m | 53 +++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/TodoList/TodoList/main.m b/TodoList/TodoList/main.m index ac90440..5b3e0cb 100644 --- a/TodoList/TodoList/main.m +++ b/TodoList/TodoList/main.m @@ -5,23 +5,34 @@ // Created by Michael Kavouras on 6/25/15. // Copyright (c) 2015 Mike Kavouras. All rights reserved. // -// delete this add + #import +#import "ListManager.h" +#import "List.h" +#import "ListItem.h" @interface toDoList: NSObject -(void) listItems : (NSMutableArray *) items; -(NSMutableArray *) items; +-(void) listManager: (NSArray *) lmanage; +-(NSArray *) lmanage; + @end @implementation toDoList { NSMutableArray *_items; + NSArray *_lmanage; } - -(void) listItems : (NSMutableArray *) items{ - _items = items; - } +-(void) listItems : (NSMutableArray *) items{ + _items = items; +} + +-(void) listManager: (NSArray *) lmanage { + _lmanage = lmanage; +} @@ -31,14 +42,17 @@ int main(int argc, const char * argv[]) { @autoreleasepool { - - - } + toDoList *manage = [[toDoList alloc]init]; + + // [manage lmanage:@"Study,", @"Swim", @"Run", @"Jump"]; + + + printf("To-Do List App\n\n\n"); - printf("a) Add Item\n\nb) Delete Item\n\nc) Edit Item\n\nd) Mark Item Done\n\ne) Show Active List\n"); + printf("a) Add Item\n\nb) Delete Item\n\nc) Edit Item\n\nd) Mark Item Done\n\ne) Show Active List \n\nq) Quit\n"); char option; int tasks = 0; @@ -50,10 +64,14 @@ int main(int argc, const char * argv[]) { fpurge(stdin); if (option == 'a') { - + // ask for a title + // create a list item instance + // set the itemName of the list item instance + // add list item to list NSLog(@"What would you like to add?\n", option); + } else if (option == 'b') { NSLog(@"Delete which task?", option); @@ -69,15 +87,22 @@ int main(int argc, const char * argv[]) { } else if (option == 'e') { NSLog(@"This is your current list: ", option); + } else if (option == 'q') { + NSLog(@"See Ya!!!"); + break; } - else if (option !='a,b,c,d,e') { - NSLog(@"Invalid", option); + else { + NSLog(@"Invalid Option! \n\na)Add Item b)Delete Item \n\nc)Edit\n\n", option); } + } - return 0; + + } - - + return 0; +} + + From ed08ed524619367f3623c0e9d1b04b2580c392a2 Mon Sep 17 00:00:00 2001 From: Brian Date: Sun, 28 Jun 2015 16:28:05 -0400 Subject: [PATCH 16/19] more added --- TodoList/TodoList/List.h | 60 ++++++++++++++++++++-------------------- TodoList/TodoList/List.m | 24 ++++++++-------- TodoList/TodoList/main.m | 47 +++++++++++++++++++++++-------- 3 files changed, 77 insertions(+), 54 deletions(-) diff --git a/TodoList/TodoList/List.h b/TodoList/TodoList/List.h index 46706c3..fad50d4 100644 --- a/TodoList/TodoList/List.h +++ b/TodoList/TodoList/List.h @@ -1,31 +1,31 @@ +//// +//// List.h +//// TodoList +//// +//// Created by Charles Kang on 6/27/15. +//// Copyright (c) 2015 Mike Kavouras. All rights reserved. +//// // -// List.h -// TodoList -// -// Created by Charles Kang on 6/27/15. -// Copyright (c) 2015 Mike Kavouras. All rights reserved. -// - -#import - -@class listItem; - -@interface List : NSObject - -@property (nonatomic) NSString *listName; - --(instancetype) initWithName:(NSString *) name; - --(void) printCommand; --(void) createList; --(void) addList; --(void) deleteList: (int) index; --(void) editItem: (int) index; --(void) markDone: (int) index; --(void) printLists; --(void) go; --(void) active; --(void) inactive; - - -@end +//#import +// +//@class listItem; +// +//@interface List : NSObject +// +//@property (nonatomic) NSString *listName; +// +//-(instancetype) initWithName:(NSString *) name; +// +//-(void) printCommand; +//-(void) createList; +//-(void) addList; +//-(void) deleteList: (int) index; +//-(void) editItem: (int) index; +//-(void) markDone: (int) index; +//-(void) printLists; +//-(void) go; +//-(void) active; +//-(void) inactive; +// +// +//@end diff --git a/TodoList/TodoList/List.m b/TodoList/TodoList/List.m index e16caf3..4db48a3 100644 --- a/TodoList/TodoList/List.m +++ b/TodoList/TodoList/List.m @@ -1,15 +1,15 @@ +//// +//// List.m +//// TodoList +//// +//// Created by Charles Kang on 6/27/15. +//// Copyright (c) 2015 Mike Kavouras. All rights reserved. +//// // -// List.m -// TodoList +//#import "List.h" // -// Created by Charles Kang on 6/27/15. -// Copyright (c) 2015 Mike Kavouras. All rights reserved. // - -#import "List.h" - - - -@implementation List : NSObject ; - -@end +// +//@implementation List : NSObject ; +// +//@end diff --git a/TodoList/TodoList/main.m b/TodoList/TodoList/main.m index 5b3e0cb..671947f 100644 --- a/TodoList/TodoList/main.m +++ b/TodoList/TodoList/main.m @@ -8,32 +8,57 @@ #import #import "ListManager.h" -#import "List.h" +//#import "List.h" #import "ListItem.h" -@interface toDoList: NSObject +@interface List: NSObject + +@end + +@implementation List + + +@end + +@interface ToDoList: NSObject -(void) listItems : (NSMutableArray *) items; -(NSMutableArray *) items; --(void) listManager: (NSArray *) lmanage; --(NSArray *) lmanage; +-(void) setListManger: (NSArray *) lmanage; +-(NSMutableArray *) lmanage; + +-(void) addList: (List *) list; + @end -@implementation toDoList { +@implementation ToDoList { NSMutableArray *_items; - NSArray *_lmanage; + NSMutableArray *_lmanage; + List *_list; } -(void) listItems : (NSMutableArray *) items{ _items = items; } --(void) listManager: (NSArray *) lmanage { +-(NSMutableArray *) items { + if (_lmanage == nil) { + _lmanage = [[NSMutableArray alloc] init]; + } + return _lmanage; +} + +-(void) setListManager: (NSMutableArray *) lmanage { _lmanage = lmanage; } +-(void) addList: (List *) list { + _list = list; +} + + @end @@ -42,11 +67,9 @@ int main(int argc, const char * argv[]) { @autoreleasepool { - toDoList *manage = [[toDoList alloc]init]; - - // [manage lmanage:@"Study,", @"Swim", @"Run", @"Jump"]; - - + ToDoList *lmanage = [[ToDoList alloc]init]; + List *list = [[List alloc]init]; + printf("To-Do List App\n\n\n"); From 1b9e98f9955a5ac264afc9bdcff68661c1b78528 Mon Sep 17 00:00:00 2001 From: Charles Kang Date: Sun, 28 Jun 2015 17:52:48 -0400 Subject: [PATCH 17/19] made good progress --- TodoList/TodoList.xcodeproj/project.pbxproj | 18 ----- TodoList/TodoList/List.h | 31 --------- TodoList/TodoList/List.m | 15 ---- TodoList/TodoList/ListItem.h | 20 ------ TodoList/TodoList/ListItem.m | 27 -------- TodoList/TodoList/ListManager.h | 28 -------- TodoList/TodoList/ListManager.m | 18 ----- TodoList/TodoList/main.m | 77 +++++++++++++++------ 8 files changed, 57 insertions(+), 177 deletions(-) delete mode 100644 TodoList/TodoList/List.h delete mode 100644 TodoList/TodoList/List.m delete mode 100644 TodoList/TodoList/ListItem.h delete mode 100644 TodoList/TodoList/ListItem.m delete mode 100644 TodoList/TodoList/ListManager.h delete mode 100644 TodoList/TodoList/ListManager.m diff --git a/TodoList/TodoList.xcodeproj/project.pbxproj b/TodoList/TodoList.xcodeproj/project.pbxproj index 23822c5..8057c4f 100644 --- a/TodoList/TodoList.xcodeproj/project.pbxproj +++ b/TodoList/TodoList.xcodeproj/project.pbxproj @@ -8,9 +8,6 @@ /* Begin PBXBuildFile section */ 8D9789F71B3C9A7F007CF4CF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D9789F61B3C9A7F007CF4CF /* main.m */; }; - BF668D5F1B3F8DBC0047500D /* ListManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BF668D5E1B3F8DBC0047500D /* ListManager.m */; }; - BF668D621B3F90050047500D /* List.m in Sources */ = {isa = PBXBuildFile; fileRef = BF668D611B3F90050047500D /* List.m */; }; - BF668D651B3F90150047500D /* ListItem.m in Sources */ = {isa = PBXBuildFile; fileRef = BF668D641B3F90150047500D /* ListItem.m */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -28,12 +25,6 @@ /* Begin PBXFileReference section */ 8D9789F31B3C9A7F007CF4CF /* TodoList */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TodoList; sourceTree = BUILT_PRODUCTS_DIR; }; 8D9789F61B3C9A7F007CF4CF /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - BF668D5D1B3F8DBC0047500D /* ListManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListManager.h; sourceTree = ""; }; - BF668D5E1B3F8DBC0047500D /* ListManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListManager.m; sourceTree = ""; }; - BF668D601B3F90050047500D /* List.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = List.h; sourceTree = ""; }; - BF668D611B3F90050047500D /* List.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = List.m; sourceTree = ""; }; - BF668D631B3F90150047500D /* ListItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListItem.h; sourceTree = ""; }; - BF668D641B3F90150047500D /* ListItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListItem.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -66,12 +57,6 @@ 8D9789F51B3C9A7F007CF4CF /* TodoList */ = { isa = PBXGroup; children = ( - BF668D5D1B3F8DBC0047500D /* ListManager.h */, - BF668D5E1B3F8DBC0047500D /* ListManager.m */, - BF668D601B3F90050047500D /* List.h */, - BF668D611B3F90050047500D /* List.m */, - BF668D631B3F90150047500D /* ListItem.h */, - BF668D641B3F90150047500D /* ListItem.m */, 8D9789F61B3C9A7F007CF4CF /* main.m */, ); path = TodoList; @@ -133,10 +118,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BF668D651B3F90150047500D /* ListItem.m in Sources */, - BF668D621B3F90050047500D /* List.m in Sources */, 8D9789F71B3C9A7F007CF4CF /* main.m in Sources */, - BF668D5F1B3F8DBC0047500D /* ListManager.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/TodoList/TodoList/List.h b/TodoList/TodoList/List.h deleted file mode 100644 index fad50d4..0000000 --- a/TodoList/TodoList/List.h +++ /dev/null @@ -1,31 +0,0 @@ -//// -//// List.h -//// TodoList -//// -//// Created by Charles Kang on 6/27/15. -//// Copyright (c) 2015 Mike Kavouras. All rights reserved. -//// -// -//#import -// -//@class listItem; -// -//@interface List : NSObject -// -//@property (nonatomic) NSString *listName; -// -//-(instancetype) initWithName:(NSString *) name; -// -//-(void) printCommand; -//-(void) createList; -//-(void) addList; -//-(void) deleteList: (int) index; -//-(void) editItem: (int) index; -//-(void) markDone: (int) index; -//-(void) printLists; -//-(void) go; -//-(void) active; -//-(void) inactive; -// -// -//@end diff --git a/TodoList/TodoList/List.m b/TodoList/TodoList/List.m deleted file mode 100644 index 4db48a3..0000000 --- a/TodoList/TodoList/List.m +++ /dev/null @@ -1,15 +0,0 @@ -//// -//// List.m -//// TodoList -//// -//// Created by Charles Kang on 6/27/15. -//// Copyright (c) 2015 Mike Kavouras. All rights reserved. -//// -// -//#import "List.h" -// -// -// -//@implementation List : NSObject ; -// -//@end diff --git a/TodoList/TodoList/ListItem.h b/TodoList/TodoList/ListItem.h deleted file mode 100644 index 1d1fb16..0000000 --- a/TodoList/TodoList/ListItem.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// ListItem.h -// TodoList -// -// Created by Charles Kang on 6/27/15. -// Copyright (c) 2015 Mike Kavouras. All rights reserved. -// - -#import - - -@interface ListItem : NSObject - --(instancetype): initWithDefaultAndName :(NSString *) name; - -@property (nonatomic) NSInteger priority; -@property (nonatomic) NSString *itemName; -@property (nonatomic) BOOL finished; - -@end diff --git a/TodoList/TodoList/ListItem.m b/TodoList/TodoList/ListItem.m deleted file mode 100644 index 45ca631..0000000 --- a/TodoList/TodoList/ListItem.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// ListItem.m -// TodoList -// -// Created by Charles Kang on 6/27/15. -// Copyright (c) 2015 Mike Kavouras. All rights reserved. -// - - -#import "ListItem.h" - -@implementation ListItem - -- (instancetype) initWithDefaultAndName:(NSString *)name{ - - if(self = [super init]){ - self.priority = 1; - self.finished = NO; - self.itemName = name; - - return self; - } - return nil; -} - - -@end diff --git a/TodoList/TodoList/ListManager.h b/TodoList/TodoList/ListManager.h deleted file mode 100644 index 3153b45..0000000 --- a/TodoList/TodoList/ListManager.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// ListManager.h -// TodoList -// -// Created by Charles Kang on 6/27/15. -// Copyright (c) 2015 Mike Kavouras. All rights reserved. -// - -#import -#import "ListManager.h" -#import "List.h" -#import "ListItem.h" - -@interface ListManager : NSObject - --(void) printCommand; --(void) addList; --(void) deleteList: (int) index; --(void) editItem: (int) index; --(void) markDone: (int) index; --(void) printLists; --(void) priority; --(void) active; --(void) inactive; - - -@end - diff --git a/TodoList/TodoList/ListManager.m b/TodoList/TodoList/ListManager.m deleted file mode 100644 index 8917946..0000000 --- a/TodoList/TodoList/ListManager.m +++ /dev/null @@ -1,18 +0,0 @@ -// -// ListManager.m -// TodoList -// -// Created by Charles Kang on 6/27/15. -// Copyright (c) 2015 Mike Kavouras. All rights reserved. -// - -#import "ListManager.h" - -@implementation ListManager - --(void) printCommand { - - -} - -@end diff --git a/TodoList/TodoList/main.m b/TodoList/TodoList/main.m index 671947f..b8110e7 100644 --- a/TodoList/TodoList/main.m +++ b/TodoList/TodoList/main.m @@ -7,19 +7,46 @@ // #import -#import "ListManager.h" +#//import "ListManager.h" //#import "List.h" -#import "ListItem.h" +//#import "ListItem.h" + +@interface Item: NSObject + +@end + +@implementation Item + +@end + @interface List: NSObject +- (void) addItem:(NSString *)item; +- (NSArray *)contents; + @end -@implementation List +@implementation List{ + NSMutableArray *_contents; +} + +- (id)init { + _contents = [[NSMutableArray alloc] init]; + return self; +} + +-(void) addItem:(NSString *)item { + [_contents addObject:item]; +} +- (NSArray *)contents { + return _contents; +} @end + @interface ToDoList: NSObject -(void) listItems : (NSMutableArray *) items; -(NSMutableArray *) items; @@ -29,14 +56,11 @@ -(NSMutableArray *) lmanage; -(void) addList: (List *) list; - - @end @implementation ToDoList { NSMutableArray *_items; NSMutableArray *_lmanage; - List *_list; } -(void) listItems : (NSMutableArray *) items{ @@ -55,34 +79,43 @@ -(void) setListManager: (NSMutableArray *) lmanage { } -(void) addList: (List *) list { - _list = list; + [_items addObject:list]; } - - - @end +NSString * scanUserInput(void) { + char inputUTF8String[256]; + scanf("%s", inputUTF8String); + fpurge(stdin); + + NSString *input = [NSString stringWithUTF8String:inputUTF8String]; + return input; +} + int main(int argc, const char * argv[]) { @autoreleasepool { - ToDoList *lmanage = [[ToDoList alloc]init]; - List *list = [[List alloc]init]; - + List *list = [[List alloc] init]; - printf("To-Do List App\n\n\n"); + [lmanage addList:list]; + //list = [NSMutableArray arrayWithObjects:@"shopping, boxing, biking, eating", nil]; + //[list addItem:@"go swimming"]; - printf("a) Add Item\n\nb) Delete Item\n\nc) Edit Item\n\nd) Mark Item Done\n\ne) Show Active List \n\nq) Quit\n"); - char option; + printf("To-Do List App\n\n\n"); + int tasks = 0; while (tasks <=1000) { tasks++; + printf("a) Add Item\n\nb) Delete Item\n\nc) Edit Item\n\nd) Mark Item Done\n\ne) Show Active List \n\nq) Quit\n"); + + char option; scanf("%c", &option); fpurge(stdin); @@ -91,22 +124,26 @@ int main(int argc, const char * argv[]) { // create a list item instance // set the itemName of the list item instance // add list item to list - NSLog(@"What would you like to add?\n", option); + NSLog(@"What would you like to add?\n"); + NSString *input = scanUserInput(); + //get input here + [list addItem:input]; + NSLog(@"\n\n Your list: %@", list.contents); } else if (option == 'b') { NSLog(@"Delete which task?", option); - + NSString *input = scanUserInput(); } else if (option == 'c') { NSLog(@"What would you like to edit?", option); - + NSString *input = scanUserInput(); } else if (option == 'd') { NSLog(@"blank is done", option); - + NSString *input = scanUserInput(); } else if (option == 'e') { NSLog(@"This is your current list: ", option); From 47795855f1c089dc813ce179d66248df6eef04f5 Mon Sep 17 00:00:00 2001 From: Charles Kang Date: Tue, 30 Jun 2015 22:46:08 -0400 Subject: [PATCH 18/19] added comments --- TodoList/TodoList/main.m | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/TodoList/TodoList/main.m b/TodoList/TodoList/main.m index b8110e7..9c7c679 100644 --- a/TodoList/TodoList/main.m +++ b/TodoList/TodoList/main.m @@ -101,9 +101,6 @@ int main(int argc, const char * argv[]) { [lmanage addList:list]; - //list = [NSMutableArray arrayWithObjects:@"shopping, boxing, biking, eating", nil]; - - //[list addItem:@"go swimming"]; printf("To-Do List App\n\n\n"); @@ -113,7 +110,7 @@ int main(int argc, const char * argv[]) { { tasks++; - printf("a) Add Item\n\nb) Delete Item\n\nc) Edit Item\n\nd) Mark Item Done\n\ne) Show Active List \n\nq) Quit\n"); + printf("a) Add Item b) Delete Item\n\nc) Edit Item d) Mark Item Done\n\ne) Show Active List q) Quit\n"); char option; scanf("%c", &option); @@ -130,7 +127,7 @@ int main(int argc, const char * argv[]) { //get input here [list addItem:input]; - NSLog(@"\n\n Your list: %@", list.contents); + NSLog(@"\n\n Your list: %@", list.contents); // ask cam tomorrow about fixing line output } else if (option == 'b') { @@ -142,13 +139,13 @@ int main(int argc, const char * argv[]) { NSString *input = scanUserInput(); } else if (option == 'd') { - NSLog(@"blank is done", option); + NSLog(@" Blank is done", option); // why is this breaking? NSString *input = scanUserInput(); } else if (option == 'e') { NSLog(@"This is your current list: ", option); } else if (option == 'q') { - NSLog(@"See Ya!!!"); + NSLog(@"See you next time!"); break; } else { @@ -165,5 +162,11 @@ int main(int argc, const char * argv[]) { +// what we still need +// editing items +// deleting items +// marking items done +// showing active list +// - +// done: adding items, quitting program From 0bf0de4b67a11beba274b4f5670582f8a469ffb7 Mon Sep 17 00:00:00 2001 From: Charles Kang Date: Wed, 1 Jul 2015 22:11:26 -0400 Subject: [PATCH 19/19] made final changes and comments --- TodoList/TodoList/main.m | 86 +++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 50 deletions(-) diff --git a/TodoList/TodoList/main.m b/TodoList/TodoList/main.m index 9c7c679..7455009 100644 --- a/TodoList/TodoList/main.m +++ b/TodoList/TodoList/main.m @@ -7,27 +7,22 @@ // #import -#//import "ListManager.h" -//#import "List.h" -//#import "ListItem.h" -@interface Item: NSObject -@end - -@implementation Item +@interface Item: NSObject // making an item class @end +@interface List: NSObject // making a list class + -@interface List: NSObject +- (void) addItem:(NSString *)item; // declaring method of additem -- (void) addItem:(NSString *)item; - (NSArray *)contents; @end -@implementation List{ +@implementation List { NSMutableArray *_contents; } @@ -40,19 +35,22 @@ -(void) addItem:(NSString *)item { [_contents addObject:item]; } +// returns current list - (NSArray *)contents { return _contents; } + @end @interface ToDoList: NSObject + -(void) listItems : (NSMutableArray *) items; -(NSMutableArray *) items; --(void) setListManger: (NSArray *) lmanage; --(NSMutableArray *) lmanage; +-(void) setListManger: (NSArray *) listManage; +-(NSMutableArray *) listManage; -(void) addList: (List *) list; @@ -60,7 +58,7 @@ -(void) addList: (List *) list; @implementation ToDoList { NSMutableArray *_items; - NSMutableArray *_lmanage; + NSMutableArray *_listManage; } -(void) listItems : (NSMutableArray *) items{ @@ -68,22 +66,24 @@ -(void) listItems : (NSMutableArray *) items{ } -(NSMutableArray *) items { - if (_lmanage == nil) { - _lmanage = [[NSMutableArray alloc] init]; + if (_listManage == nil) { + _listManage = [[NSMutableArray alloc] init]; } - return _lmanage; + return _listManage; } --(void) setListManager: (NSMutableArray *) lmanage { - _lmanage = lmanage; +-(void) setListManager: (NSMutableArray *) listManage { + _listManage = _listManage; } -(void) addList: (List *) list { [_items addObject:list]; } + @end +// this lets the program know to take user input NSString * scanUserInput(void) { char inputUTF8String[256]; scanf("%s", inputUTF8String); @@ -91,19 +91,20 @@ -(void) addList: (List *) list { NSString *input = [NSString stringWithUTF8String:inputUTF8String]; return input; + // this returns whatever the person inputs } int main(int argc, const char * argv[]) { @autoreleasepool { - ToDoList *lmanage = [[ToDoList alloc]init]; - List *list = [[List alloc] init]; + ToDoList *listManage = [[ToDoList alloc]init]; + List *list = [[List alloc] init]; // initializing instance of ToDoList and List - [lmanage addList:list]; + [listManage addList:list]; // communicating with class printf("To-Do List App\n\n\n"); - + int tasks = 0; while (tasks <=1000) @@ -117,30 +118,30 @@ int main(int argc, const char * argv[]) { fpurge(stdin); if (option == 'a') { - // ask for a title - // create a list item instance - // set the itemName of the list item instance - // add list item to list - NSLog(@"What would you like to add?\n"); + + NSLog(@"What would you like to add?"); + NSLog(@"Your list: %@", list.contents); NSString *input = scanUserInput(); - //get input here + [list addItem:input]; - NSLog(@"\n\n Your list: %@", list.contents); // ask cam tomorrow about fixing line output + } else if (option == 'b') { NSLog(@"Delete which task?", option); - NSString *input = scanUserInput(); + // NSString *input = scanUserInput(); } else if (option == 'c') { NSLog(@"What would you like to edit?", option); - NSString *input = scanUserInput(); + // NSString *input = scanUserInput(); + NSLog(@" %@ is done", option); + } else if (option == 'd') { - NSLog(@" Blank is done", option); // why is this breaking? - NSString *input = scanUserInput(); + NSLog(@" %@ is done", option); // why is this breaking? + // NSString *input = scanUserInput(); } else if (option == 'e') { NSLog(@"This is your current list: ", option); @@ -148,25 +149,10 @@ int main(int argc, const char * argv[]) { NSLog(@"See you next time!"); break; } - else { - NSLog(@"Invalid Option! \n\na)Add Item b)Delete Item \n\nc)Edit\n\n", option); + else { + NSLog(@"Invalid Option!\n", option); } - } - - } return 0; } - - - - -// what we still need -// editing items -// deleting items -// marking items done -// showing active list -// - -// done: adding items, quitting program