From 88b3ccc0f0cc306d6227392eceaf1e8f67c15a04 Mon Sep 17 00:00:00 2001 From: Jamaal Sedayao Date: Sun, 4 Oct 2015 17:35:21 -0400 Subject: [PATCH 1/5] saved file --- .DS_Store | Bin 0 -> 6148 bytes MarsWater/.DS_Store | Bin 0 -> 6148 bytes MarsWater/List+CoreDataProperties.h | 25 ++ MarsWater/List+CoreDataProperties.m | 21 + MarsWater/List.h | 22 ++ MarsWater/List.m | 15 + MarsWater/MarsWater.xcodeproj/project.pbxproj | 363 ++++++++++++++++++ .../contents.xcworkspacedata | 2 +- MarsWater/MarsWater/.DS_Store | Bin 0 -> 6148 bytes .../MarsWater}/AppDelegate.h | 6 +- .../MarsWater}/AppDelegate.m | 12 +- .../AppIcon.appiconset/Contents.json | 30 ++ .../Base.lproj/LaunchScreen.storyboard | 4 +- .../MarsWater/Base.lproj/Main.storyboard | 233 +++++++++++ .../MarsWater}/Info.plist | 7 + .../ListCreationTableViewController.h | 13 + .../ListCreationTableViewController.m | 68 ++++ MarsWater/MarsWater/ListTableViewController.h | 13 + MarsWater/MarsWater/ListTableViewController.m | 74 ++++ .../MarsWater.xcdatamodeld}/.xccurrentversion | 2 +- .../MarsWater.xcdatamodel/contents | 22 ++ .../MarsWater}/main.m | 6 +- MarsWater/Task+CoreDataProperties.h | 28 ++ MarsWater/Task+CoreDataProperties.m | 24 ++ MarsWater/Task.h | 24 ++ MarsWater/Task.m | 16 + .../SavingForever.xcodeproj/project.pbxproj | 322 ---------------- .../SavingForever/Base.lproj/Main.storyboard | 25 -- .../SavingForever.xcdatamodel/contents | 4 - SavingForever/SavingForever/ViewController.h | 15 - SavingForever/SavingForever/ViewController.m | 27 -- 31 files changed, 1014 insertions(+), 409 deletions(-) create mode 100644 .DS_Store create mode 100644 MarsWater/.DS_Store create mode 100644 MarsWater/List+CoreDataProperties.h create mode 100644 MarsWater/List+CoreDataProperties.m create mode 100644 MarsWater/List.h create mode 100644 MarsWater/List.m create mode 100644 MarsWater/MarsWater.xcodeproj/project.pbxproj rename {SavingForever/SavingForever.xcodeproj => MarsWater/MarsWater.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (68%) create mode 100644 MarsWater/MarsWater/.DS_Store rename {SavingForever/SavingForever => MarsWater/MarsWater}/AppDelegate.h (81%) rename {SavingForever/SavingForever => MarsWater/MarsWater}/AppDelegate.m (93%) rename {SavingForever/SavingForever => MarsWater/MarsWater}/Assets.xcassets/AppIcon.appiconset/Contents.json (54%) rename {SavingForever/SavingForever => MarsWater/MarsWater}/Base.lproj/LaunchScreen.storyboard (84%) create mode 100644 MarsWater/MarsWater/Base.lproj/Main.storyboard rename {SavingForever/SavingForever => MarsWater/MarsWater}/Info.plist (80%) create mode 100644 MarsWater/MarsWater/ListCreationTableViewController.h create mode 100644 MarsWater/MarsWater/ListCreationTableViewController.m create mode 100644 MarsWater/MarsWater/ListTableViewController.h create mode 100644 MarsWater/MarsWater/ListTableViewController.m rename {SavingForever/SavingForever/SavingForever.xcdatamodeld => MarsWater/MarsWater/MarsWater.xcdatamodeld}/.xccurrentversion (83%) create mode 100644 MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents rename {SavingForever/SavingForever => MarsWater/MarsWater}/main.m (64%) create mode 100644 MarsWater/Task+CoreDataProperties.h create mode 100644 MarsWater/Task+CoreDataProperties.m create mode 100644 MarsWater/Task.h create mode 100644 MarsWater/Task.m delete mode 100644 SavingForever/SavingForever.xcodeproj/project.pbxproj delete mode 100644 SavingForever/SavingForever/Base.lproj/Main.storyboard delete mode 100644 SavingForever/SavingForever/SavingForever.xcdatamodeld/SavingForever.xcdatamodel/contents delete mode 100644 SavingForever/SavingForever/ViewController.h delete mode 100644 SavingForever/SavingForever/ViewController.m diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0`1*nP9}u{--9*&P6~*w%Ak24KprC@PFJRganu+<8Kjyv8+dvB4eII2&2$FRC>6 zV_Y)tHJ-4W|1&DIsCk->wib`8`}wkJo6e5$avZg!9Xw&418gLZ+awl#lo>SRF&#;2|(0mbZ(Tj zmQY)AEF617TG+%wi54neVu*!PpWLr->Cyf&Y#7L&#JdKK6x4;}%W=zruS d8_k|nreERM8|o^m&*8*)2xLNH2nK$Efe-r5Jv{&b literal 0 HcmV?d00001 diff --git a/MarsWater/List+CoreDataProperties.h b/MarsWater/List+CoreDataProperties.h new file mode 100644 index 0000000..9593078 --- /dev/null +++ b/MarsWater/List+CoreDataProperties.h @@ -0,0 +1,25 @@ +// +// List+CoreDataProperties.h +// MarsWater +// +// Created by Jamaal Sedayao on 10/4/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// +// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu +// to delete and recreate this implementation file for your updated model. +// + +#import "List.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface List (CoreDataProperties) + +@property (nullable, nonatomic, retain) NSString *title; +@property (nullable, nonatomic, retain) NSDate *createdAt; +@property (nullable, nonatomic, retain) id color; +@property (nullable, nonatomic, retain) NSArray *task; + +@end + +NS_ASSUME_NONNULL_END diff --git a/MarsWater/List+CoreDataProperties.m b/MarsWater/List+CoreDataProperties.m new file mode 100644 index 0000000..3ce5172 --- /dev/null +++ b/MarsWater/List+CoreDataProperties.m @@ -0,0 +1,21 @@ +// +// List+CoreDataProperties.m +// MarsWater +// +// Created by Jamaal Sedayao on 10/4/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// +// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu +// to delete and recreate this implementation file for your updated model. +// + +#import "List+CoreDataProperties.h" + +@implementation List (CoreDataProperties) + +@dynamic title; +@dynamic createdAt; +@dynamic color; +@dynamic task; + +@end diff --git a/MarsWater/List.h b/MarsWater/List.h new file mode 100644 index 0000000..5fb28ab --- /dev/null +++ b/MarsWater/List.h @@ -0,0 +1,22 @@ +// +// List.h +// MarsWater +// +// Created by Jamaal Sedayao on 10/4/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface List : NSManagedObject + +// Insert code here to declare functionality of your managed object subclass + +@end + +NS_ASSUME_NONNULL_END + +#import "List+CoreDataProperties.h" diff --git a/MarsWater/List.m b/MarsWater/List.m new file mode 100644 index 0000000..7451bbb --- /dev/null +++ b/MarsWater/List.m @@ -0,0 +1,15 @@ +// +// List.m +// MarsWater +// +// Created by Jamaal Sedayao on 10/4/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// + +#import "List.h" + +@implementation List + +// Insert code here to add functionality to your managed object subclass + +@end diff --git a/MarsWater/MarsWater.xcodeproj/project.pbxproj b/MarsWater/MarsWater.xcodeproj/project.pbxproj new file mode 100644 index 0000000..eca0e9e --- /dev/null +++ b/MarsWater/MarsWater.xcodeproj/project.pbxproj @@ -0,0 +1,363 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 9A0BA0DF1BC1AE6100AEBB43 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0BA0DE1BC1AE6100AEBB43 /* main.m */; }; + 9A0BA0E21BC1AE6100AEBB43 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0BA0E11BC1AE6100AEBB43 /* AppDelegate.m */; }; + 9A0BA0E81BC1AE6100AEBB43 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9A0BA0E61BC1AE6100AEBB43 /* Main.storyboard */; }; + 9A0BA0EB1BC1AE6100AEBB43 /* MarsWater.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 9A0BA0E91BC1AE6100AEBB43 /* MarsWater.xcdatamodeld */; }; + 9A0BA0ED1BC1AE6200AEBB43 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9A0BA0EC1BC1AE6200AEBB43 /* Assets.xcassets */; }; + 9A0BA0F01BC1AE6200AEBB43 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9A0BA0EE1BC1AE6200AEBB43 /* LaunchScreen.storyboard */; }; + 9A0BA1031BC1B32000AEBB43 /* List+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0BA0FC1BC1B32000AEBB43 /* List+CoreDataProperties.m */; settings = {ASSET_TAGS = (); }; }; + 9A0BA1041BC1B32000AEBB43 /* List.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0BA0FE1BC1B32000AEBB43 /* List.m */; settings = {ASSET_TAGS = (); }; }; + 9A0BA1051BC1B32000AEBB43 /* Task+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0BA1001BC1B32000AEBB43 /* Task+CoreDataProperties.m */; settings = {ASSET_TAGS = (); }; }; + 9A0BA1061BC1B32000AEBB43 /* Task.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0BA1021BC1B32000AEBB43 /* Task.m */; settings = {ASSET_TAGS = (); }; }; + 9A0BA1091BC1B91200AEBB43 /* ListTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0BA1081BC1B91200AEBB43 /* ListTableViewController.m */; settings = {ASSET_TAGS = (); }; }; + 9A0BA10C1BC1B92100AEBB43 /* ListCreationTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0BA10B1BC1B92100AEBB43 /* ListCreationTableViewController.m */; settings = {ASSET_TAGS = (); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 9A0BA0DA1BC1AE6100AEBB43 /* MarsWater.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MarsWater.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 9A0BA0DE1BC1AE6100AEBB43 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 9A0BA0E01BC1AE6100AEBB43 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 9A0BA0E11BC1AE6100AEBB43 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 9A0BA0E71BC1AE6100AEBB43 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 9A0BA0EA1BC1AE6100AEBB43 /* MarsWater.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MarsWater.xcdatamodel; sourceTree = ""; }; + 9A0BA0EC1BC1AE6200AEBB43 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 9A0BA0EF1BC1AE6200AEBB43 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 9A0BA0F11BC1AE6200AEBB43 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9A0BA0FB1BC1B32000AEBB43 /* List+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "List+CoreDataProperties.h"; path = "../List+CoreDataProperties.h"; sourceTree = ""; }; + 9A0BA0FC1BC1B32000AEBB43 /* List+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "List+CoreDataProperties.m"; path = "../List+CoreDataProperties.m"; sourceTree = ""; }; + 9A0BA0FD1BC1B32000AEBB43 /* List.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = List.h; path = ../List.h; sourceTree = ""; }; + 9A0BA0FE1BC1B32000AEBB43 /* List.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = List.m; path = ../List.m; sourceTree = ""; }; + 9A0BA0FF1BC1B32000AEBB43 /* Task+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Task+CoreDataProperties.h"; path = "../Task+CoreDataProperties.h"; sourceTree = ""; }; + 9A0BA1001BC1B32000AEBB43 /* Task+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "Task+CoreDataProperties.m"; path = "../Task+CoreDataProperties.m"; sourceTree = ""; }; + 9A0BA1011BC1B32000AEBB43 /* Task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Task.h; path = ../Task.h; sourceTree = ""; }; + 9A0BA1021BC1B32000AEBB43 /* Task.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Task.m; path = ../Task.m; sourceTree = ""; }; + 9A0BA1071BC1B91200AEBB43 /* ListTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListTableViewController.h; sourceTree = ""; }; + 9A0BA1081BC1B91200AEBB43 /* ListTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListTableViewController.m; sourceTree = ""; }; + 9A0BA10A1BC1B92100AEBB43 /* ListCreationTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListCreationTableViewController.h; sourceTree = ""; }; + 9A0BA10B1BC1B92100AEBB43 /* ListCreationTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListCreationTableViewController.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 9A0BA0D71BC1AE6100AEBB43 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9A0BA0D11BC1AE6100AEBB43 = { + isa = PBXGroup; + children = ( + 9A0BA0DC1BC1AE6100AEBB43 /* MarsWater */, + 9A0BA0DB1BC1AE6100AEBB43 /* Products */, + ); + sourceTree = ""; + }; + 9A0BA0DB1BC1AE6100AEBB43 /* Products */ = { + isa = PBXGroup; + children = ( + 9A0BA0DA1BC1AE6100AEBB43 /* MarsWater.app */, + ); + name = Products; + sourceTree = ""; + }; + 9A0BA0DC1BC1AE6100AEBB43 /* MarsWater */ = { + isa = PBXGroup; + children = ( + 9A0BA0FA1BC1B27100AEBB43 /* Model */, + 9A0BA0E01BC1AE6100AEBB43 /* AppDelegate.h */, + 9A0BA0E11BC1AE6100AEBB43 /* AppDelegate.m */, + 9A0BA1071BC1B91200AEBB43 /* ListTableViewController.h */, + 9A0BA1081BC1B91200AEBB43 /* ListTableViewController.m */, + 9A0BA10A1BC1B92100AEBB43 /* ListCreationTableViewController.h */, + 9A0BA10B1BC1B92100AEBB43 /* ListCreationTableViewController.m */, + 9A0BA0E61BC1AE6100AEBB43 /* Main.storyboard */, + 9A0BA0EC1BC1AE6200AEBB43 /* Assets.xcassets */, + 9A0BA0EE1BC1AE6200AEBB43 /* LaunchScreen.storyboard */, + 9A0BA0F11BC1AE6200AEBB43 /* Info.plist */, + 9A0BA0E91BC1AE6100AEBB43 /* MarsWater.xcdatamodeld */, + 9A0BA0DD1BC1AE6100AEBB43 /* Supporting Files */, + ); + path = MarsWater; + sourceTree = ""; + }; + 9A0BA0DD1BC1AE6100AEBB43 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 9A0BA0DE1BC1AE6100AEBB43 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 9A0BA0FA1BC1B27100AEBB43 /* Model */ = { + isa = PBXGroup; + children = ( + 9A0BA0FB1BC1B32000AEBB43 /* List+CoreDataProperties.h */, + 9A0BA0FC1BC1B32000AEBB43 /* List+CoreDataProperties.m */, + 9A0BA0FD1BC1B32000AEBB43 /* List.h */, + 9A0BA0FE1BC1B32000AEBB43 /* List.m */, + 9A0BA0FF1BC1B32000AEBB43 /* Task+CoreDataProperties.h */, + 9A0BA1001BC1B32000AEBB43 /* Task+CoreDataProperties.m */, + 9A0BA1011BC1B32000AEBB43 /* Task.h */, + 9A0BA1021BC1B32000AEBB43 /* Task.m */, + ); + name = Model; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 9A0BA0D91BC1AE6100AEBB43 /* MarsWater */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9A0BA0F41BC1AE6200AEBB43 /* Build configuration list for PBXNativeTarget "MarsWater" */; + buildPhases = ( + 9A0BA0D61BC1AE6100AEBB43 /* Sources */, + 9A0BA0D71BC1AE6100AEBB43 /* Frameworks */, + 9A0BA0D81BC1AE6100AEBB43 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MarsWater; + productName = MarsWater; + productReference = 9A0BA0DA1BC1AE6100AEBB43 /* MarsWater.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 9A0BA0D21BC1AE6100AEBB43 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0700; + ORGANIZATIONNAME = "Jamaal Sedayao"; + TargetAttributes = { + 9A0BA0D91BC1AE6100AEBB43 = { + CreatedOnToolsVersion = 7.0; + DevelopmentTeam = Z368FJ9ZFJ; + }; + }; + }; + buildConfigurationList = 9A0BA0D51BC1AE6100AEBB43 /* Build configuration list for PBXProject "MarsWater" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 9A0BA0D11BC1AE6100AEBB43; + productRefGroup = 9A0BA0DB1BC1AE6100AEBB43 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 9A0BA0D91BC1AE6100AEBB43 /* MarsWater */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 9A0BA0D81BC1AE6100AEBB43 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9A0BA0F01BC1AE6200AEBB43 /* LaunchScreen.storyboard in Resources */, + 9A0BA0ED1BC1AE6200AEBB43 /* Assets.xcassets in Resources */, + 9A0BA0E81BC1AE6100AEBB43 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 9A0BA0D61BC1AE6100AEBB43 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9A0BA0EB1BC1AE6100AEBB43 /* MarsWater.xcdatamodeld in Sources */, + 9A0BA1051BC1B32000AEBB43 /* Task+CoreDataProperties.m in Sources */, + 9A0BA0E21BC1AE6100AEBB43 /* AppDelegate.m in Sources */, + 9A0BA1061BC1B32000AEBB43 /* Task.m in Sources */, + 9A0BA1041BC1B32000AEBB43 /* List.m in Sources */, + 9A0BA1031BC1B32000AEBB43 /* List+CoreDataProperties.m in Sources */, + 9A0BA10C1BC1B92100AEBB43 /* ListCreationTableViewController.m in Sources */, + 9A0BA0DF1BC1AE6100AEBB43 /* main.m in Sources */, + 9A0BA1091BC1B91200AEBB43 /* ListTableViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 9A0BA0E61BC1AE6100AEBB43 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 9A0BA0E71BC1AE6100AEBB43 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 9A0BA0EE1BC1AE6200AEBB43 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 9A0BA0EF1BC1AE6200AEBB43 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 9A0BA0F21BC1AE6200AEBB43 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 9A0BA0F31BC1AE6200AEBB43 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 9A0BA0F51BC1AE6200AEBB43 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = MarsWater/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.jamaalsedayao.MarsWater; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 9A0BA0F61BC1AE6200AEBB43 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = MarsWater/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.jamaalsedayao.MarsWater; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 9A0BA0D51BC1AE6100AEBB43 /* Build configuration list for PBXProject "MarsWater" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9A0BA0F21BC1AE6200AEBB43 /* Debug */, + 9A0BA0F31BC1AE6200AEBB43 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 9A0BA0F41BC1AE6200AEBB43 /* Build configuration list for PBXNativeTarget "MarsWater" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9A0BA0F51BC1AE6200AEBB43 /* Debug */, + 9A0BA0F61BC1AE6200AEBB43 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + +/* Begin XCVersionGroup section */ + 9A0BA0E91BC1AE6100AEBB43 /* MarsWater.xcdatamodeld */ = { + isa = XCVersionGroup; + children = ( + 9A0BA0EA1BC1AE6100AEBB43 /* MarsWater.xcdatamodel */, + ); + currentVersion = 9A0BA0EA1BC1AE6100AEBB43 /* MarsWater.xcdatamodel */; + path = MarsWater.xcdatamodeld; + sourceTree = ""; + versionGroupType = wrapper.xcdatamodel; + }; +/* End XCVersionGroup section */ + }; + rootObject = 9A0BA0D21BC1AE6100AEBB43 /* Project object */; +} diff --git a/SavingForever/SavingForever.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/MarsWater/MarsWater.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 68% rename from SavingForever/SavingForever.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to MarsWater/MarsWater.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 43eb427..4acdfe2 100644 --- a/SavingForever/SavingForever.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/MarsWater/MarsWater.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:MarsWater.xcodeproj"> diff --git a/MarsWater/MarsWater/.DS_Store b/MarsWater/MarsWater/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..2d9ed0800f2e18aa8dd17d58b309d417af666c3a GIT binary patch literal 6148 zcmeHKu}T9$5PcJaMr=}v<@SP*%Jv9nX_dm(a2K@5aUmvPdEaQ~-}q){2nnY}5JYqa zX5QZ1%!vGt5^9O>O~*`Wu;r zW9=n0Cpi|5ogv>)#8QctD&As^}vZS8GNYi*)FQdKmrGu)+ckV`RRwG>}b Zv(TS(Kr9?PLwYFjBamqb6Ab()10Ml0KWP8} literal 0 HcmV?d00001 diff --git a/SavingForever/SavingForever/AppDelegate.h b/MarsWater/MarsWater/AppDelegate.h similarity index 81% rename from SavingForever/SavingForever/AppDelegate.h rename to MarsWater/MarsWater/AppDelegate.h index 6657831..b3fb147 100644 --- a/SavingForever/SavingForever/AppDelegate.h +++ b/MarsWater/MarsWater/AppDelegate.h @@ -1,9 +1,9 @@ // // AppDelegate.h -// SavingForever +// MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Jamaal Sedayao on 10/4/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. // #import diff --git a/SavingForever/SavingForever/AppDelegate.m b/MarsWater/MarsWater/AppDelegate.m similarity index 93% rename from SavingForever/SavingForever/AppDelegate.m rename to MarsWater/MarsWater/AppDelegate.m index 29b2305..1a3ab97 100644 --- a/SavingForever/SavingForever/AppDelegate.m +++ b/MarsWater/MarsWater/AppDelegate.m @@ -1,9 +1,9 @@ // // AppDelegate.m -// SavingForever +// MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Jamaal Sedayao on 10/4/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. // #import "AppDelegate.h" @@ -51,7 +51,7 @@ - (void)applicationWillTerminate:(UIApplication *)application { @synthesize persistentStoreCoordinator = _persistentStoreCoordinator; - (NSURL *)applicationDocumentsDirectory { - // The directory the application uses to store the Core Data store file. This code uses a directory named "com.mikekavouras.SavingForever" in the application's documents directory. + // The directory the application uses to store the Core Data store file. This code uses a directory named "com.jamaalsedayao.MarsWater" in the application's documents directory. return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; } @@ -60,7 +60,7 @@ - (NSManagedObjectModel *)managedObjectModel { if (_managedObjectModel != nil) { return _managedObjectModel; } - NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"SavingForever" withExtension:@"momd"]; + NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"MarsWater" withExtension:@"momd"]; _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; return _managedObjectModel; } @@ -74,7 +74,7 @@ - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { // Create the coordinator and store _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; - NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"SavingForever.sqlite"]; + NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"MarsWater.sqlite"]; NSError *error = nil; NSString *failureReason = @"There was an error creating or loading the application's saved data."; if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) { diff --git a/SavingForever/SavingForever/Assets.xcassets/AppIcon.appiconset/Contents.json b/MarsWater/MarsWater/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 54% rename from SavingForever/SavingForever/Assets.xcassets/AppIcon.appiconset/Contents.json rename to MarsWater/MarsWater/Assets.xcassets/AppIcon.appiconset/Contents.json index 118c98f..36d2c80 100644 --- a/SavingForever/SavingForever/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/MarsWater/MarsWater/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -29,6 +29,36 @@ "idiom" : "iphone", "size" : "60x60", "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" } ], "info" : { diff --git a/SavingForever/SavingForever/Base.lproj/LaunchScreen.storyboard b/MarsWater/MarsWater/Base.lproj/LaunchScreen.storyboard similarity index 84% rename from SavingForever/SavingForever/Base.lproj/LaunchScreen.storyboard rename to MarsWater/MarsWater/Base.lproj/LaunchScreen.storyboard index 2e721e1..900bc17 100644 --- a/SavingForever/SavingForever/Base.lproj/LaunchScreen.storyboard +++ b/MarsWater/MarsWater/Base.lproj/LaunchScreen.storyboard @@ -1,7 +1,7 @@ - + - + diff --git a/MarsWater/MarsWater/Base.lproj/Main.storyboard b/MarsWater/MarsWater/Base.lproj/Main.storyboard new file mode 100644 index 0000000..fb75fd7 --- /dev/null +++ b/MarsWater/MarsWater/Base.lproj/Main.storyboard @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SavingForever/SavingForever/Info.plist b/MarsWater/MarsWater/Info.plist similarity index 80% rename from SavingForever/SavingForever/Info.plist rename to MarsWater/MarsWater/Info.plist index 6905cc6..40c6215 100644 --- a/SavingForever/SavingForever/Info.plist +++ b/MarsWater/MarsWater/Info.plist @@ -36,5 +36,12 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + diff --git a/MarsWater/MarsWater/ListCreationTableViewController.h b/MarsWater/MarsWater/ListCreationTableViewController.h new file mode 100644 index 0000000..9a78a93 --- /dev/null +++ b/MarsWater/MarsWater/ListCreationTableViewController.h @@ -0,0 +1,13 @@ +// +// ListCreationTableViewController.h +// MarsWater +// +// Created by Jamaal Sedayao on 10/4/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// + +#import + +@interface ListCreationTableViewController : UITableViewController + +@end diff --git a/MarsWater/MarsWater/ListCreationTableViewController.m b/MarsWater/MarsWater/ListCreationTableViewController.m new file mode 100644 index 0000000..6f6f617 --- /dev/null +++ b/MarsWater/MarsWater/ListCreationTableViewController.m @@ -0,0 +1,68 @@ +// +// ListCreationTableViewController.m +// MarsWater +// +// Created by Jamaal Sedayao on 10/4/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// + +#import +#import "ListCreationTableViewController.h" +#import "List.h" +#import "AppDelegate.h" + +@interface ListCreationTableViewController () + +@property (weak, nonatomic) IBOutlet UITextField *titleTextField; + +@property (nonatomic) List *list; + + +@end + +@implementation ListCreationTableViewController + +- (void) viewDidLoad{ + [super viewDidLoad]; + + [self setupNavigationBar]; + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + self.list = [NSEntityDescription insertNewObjectForEntityForName:@"List" inManagedObjectContext:delegate.managedObjectContext]; + + NSLog(@"%@",self.list); +} + +- (void) setupNavigationBar { + + self.navigationItem.title = @"Create New List"; + + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; + + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(save)]; + +} +- (void)cancel{ + [self dismissViewControllerAnimated:YES completion:nil]; +} +- (void)save{ + self.list.title = self.titleTextField.text; + self.list.createdAt = [NSDate date]; + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + [delegate.managedObjectContext save:nil]; + + [self dismissViewControllerAnimated:YES completion:nil]; + +} +- (IBAction)colorButtonTapped:(UIButton *)sender { + + self.list.color = sender.backgroundColor; +} + + + + +@end diff --git a/MarsWater/MarsWater/ListTableViewController.h b/MarsWater/MarsWater/ListTableViewController.h new file mode 100644 index 0000000..89f33dc --- /dev/null +++ b/MarsWater/MarsWater/ListTableViewController.h @@ -0,0 +1,13 @@ +// +// ListTableViewController.h +// MarsWater +// +// Created by Jamaal Sedayao on 10/4/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// + +#import + +@interface ListTableViewController : UITableViewController + +@end diff --git a/MarsWater/MarsWater/ListTableViewController.m b/MarsWater/MarsWater/ListTableViewController.m new file mode 100644 index 0000000..3da24e2 --- /dev/null +++ b/MarsWater/MarsWater/ListTableViewController.m @@ -0,0 +1,74 @@ +// +// ListTableViewController.m +// MarsWater +// +// Created by Jamaal Sedayao on 10/4/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// + +#import +#import "ListTableViewController.h" +#import "AppDelegate.h" +#import "List.h" + +@interface ListTableViewController () + +@property (nonatomic) NSFetchedResultsController *fetchedResultsController; + +@end + +@implementation ListTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + //1.create an instance of NSFetchRequest with an entity name + NSFetchRequest *fetchRequest = [[NSFetchRequest alloc]initWithEntityName:@"List"]; + + //2. create a sort descriptor + NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"createdAt" ascending:NO]; + + //3. set the sortdescriptors on the fetch request + fetchRequest.sortDescriptors = @[sort]; + + //4. create a fetchedResultsController with a fetchRequest and a managedObjectContext + self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:delegate.managedObjectContext sectionNameKeyPath:nil cacheName:nil]; + + self.fetchedResultsController.delegate = self; + + [self.fetchedResultsController performFetch:nil]; + + [self.tableView reloadData]; +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.fetchedResultsController.fetchedObjects.count; +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ListCellIdentifier" forIndexPath:indexPath]; + + List *list = self.fetchedResultsController.fetchedObjects[indexPath.row]; + cell.textLabel.text = list.title; + cell.backgroundColor = (UIColor *)list.color; + cell.detailTextLabel.text = [list.createdAt description]; + + return cell; +} + + +- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath{ + + [self.tableView reloadData]; +} + +@end diff --git a/SavingForever/SavingForever/SavingForever.xcdatamodeld/.xccurrentversion b/MarsWater/MarsWater/MarsWater.xcdatamodeld/.xccurrentversion similarity index 83% rename from SavingForever/SavingForever/SavingForever.xcdatamodeld/.xccurrentversion rename to MarsWater/MarsWater/MarsWater.xcdatamodeld/.xccurrentversion index 352ed15..5c0cbd5 100644 --- a/SavingForever/SavingForever/SavingForever.xcdatamodeld/.xccurrentversion +++ b/MarsWater/MarsWater/MarsWater.xcdatamodeld/.xccurrentversion @@ -3,6 +3,6 @@ _XCCurrentVersionName - SavingForever.xcdatamodel + MarsWater.xcdatamodel diff --git a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents new file mode 100644 index 0000000..5c909c5 --- /dev/null +++ b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SavingForever/SavingForever/main.m b/MarsWater/MarsWater/main.m similarity index 64% rename from SavingForever/SavingForever/main.m rename to MarsWater/MarsWater/main.m index 0d1314d..c643c75 100644 --- a/SavingForever/SavingForever/main.m +++ b/MarsWater/MarsWater/main.m @@ -1,9 +1,9 @@ // // main.m -// SavingForever +// MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Jamaal Sedayao on 10/4/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. // #import diff --git a/MarsWater/Task+CoreDataProperties.h b/MarsWater/Task+CoreDataProperties.h new file mode 100644 index 0000000..ea34178 --- /dev/null +++ b/MarsWater/Task+CoreDataProperties.h @@ -0,0 +1,28 @@ +// +// Task+CoreDataProperties.h +// MarsWater +// +// Created by Jamaal Sedayao on 10/4/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// +// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu +// to delete and recreate this implementation file for your updated model. +// + +#import "Task.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface Task (CoreDataProperties) + +@property (nullable, nonatomic, retain) NSString *taskDescription; +@property (nullable, nonatomic, retain) NSDate *dueAt; +@property (nullable, nonatomic, retain) NSDate *updatedAt; +@property (nullable, nonatomic, retain) NSNumber *priority; +@property (nullable, nonatomic, retain) NSDate *createdAt; +@property (nullable, nonatomic, retain) NSDate *completedAt; +@property (nullable, nonatomic, retain) List *list; + +@end + +NS_ASSUME_NONNULL_END diff --git a/MarsWater/Task+CoreDataProperties.m b/MarsWater/Task+CoreDataProperties.m new file mode 100644 index 0000000..cdb4b1f --- /dev/null +++ b/MarsWater/Task+CoreDataProperties.m @@ -0,0 +1,24 @@ +// +// Task+CoreDataProperties.m +// MarsWater +// +// Created by Jamaal Sedayao on 10/4/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// +// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu +// to delete and recreate this implementation file for your updated model. +// + +#import "Task+CoreDataProperties.h" + +@implementation Task (CoreDataProperties) + +@dynamic taskDescription; +@dynamic dueAt; +@dynamic updatedAt; +@dynamic priority; +@dynamic createdAt; +@dynamic completedAt; +@dynamic list; + +@end diff --git a/MarsWater/Task.h b/MarsWater/Task.h new file mode 100644 index 0000000..79cefba --- /dev/null +++ b/MarsWater/Task.h @@ -0,0 +1,24 @@ +// +// Task.h +// MarsWater +// +// Created by Jamaal Sedayao on 10/4/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// + +#import +#import + +@class List; + +NS_ASSUME_NONNULL_BEGIN + +@interface Task : NSManagedObject + +// Insert code here to declare functionality of your managed object subclass + +@end + +NS_ASSUME_NONNULL_END + +#import "Task+CoreDataProperties.h" diff --git a/MarsWater/Task.m b/MarsWater/Task.m new file mode 100644 index 0000000..2d3b7a7 --- /dev/null +++ b/MarsWater/Task.m @@ -0,0 +1,16 @@ +// +// Task.m +// MarsWater +// +// Created by Jamaal Sedayao on 10/4/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// + +#import "Task.h" +#import "List.h" + +@implementation Task + +// Insert code here to add functionality to your managed object subclass + +@end diff --git a/SavingForever/SavingForever.xcodeproj/project.pbxproj b/SavingForever/SavingForever.xcodeproj/project.pbxproj deleted file mode 100644 index cbf89e2..0000000 --- a/SavingForever/SavingForever.xcodeproj/project.pbxproj +++ /dev/null @@ -1,322 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 8D2949671BC1D06E00FDC81F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D2949661BC1D06E00FDC81F /* main.m */; }; - 8D29496A1BC1D06E00FDC81F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D2949691BC1D06E00FDC81F /* AppDelegate.m */; }; - 8D29496D1BC1D06E00FDC81F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D29496C1BC1D06E00FDC81F /* ViewController.m */; }; - 8D2949701BC1D06E00FDC81F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8D29496E1BC1D06E00FDC81F /* Main.storyboard */; }; - 8D2949731BC1D06E00FDC81F /* SavingForever.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 8D2949711BC1D06E00FDC81F /* SavingForever.xcdatamodeld */; }; - 8D2949751BC1D06E00FDC81F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8D2949741BC1D06E00FDC81F /* Assets.xcassets */; }; - 8D2949781BC1D06E00FDC81F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8D2949761BC1D06E00FDC81F /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 8D2949621BC1D06E00FDC81F /* SavingForever.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SavingForever.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 8D2949661BC1D06E00FDC81F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 8D2949681BC1D06E00FDC81F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 8D2949691BC1D06E00FDC81F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 8D29496B1BC1D06E00FDC81F /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - 8D29496C1BC1D06E00FDC81F /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; - 8D29496F1BC1D06E00FDC81F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 8D2949721BC1D06E00FDC81F /* SavingForever.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = SavingForever.xcdatamodel; sourceTree = ""; }; - 8D2949741BC1D06E00FDC81F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 8D2949771BC1D06E00FDC81F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 8D2949791BC1D06E00FDC81F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D29495F1BC1D06E00FDC81F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 8D2949591BC1D06D00FDC81F = { - isa = PBXGroup; - children = ( - 8D2949641BC1D06E00FDC81F /* SavingForever */, - 8D2949631BC1D06E00FDC81F /* Products */, - ); - sourceTree = ""; - }; - 8D2949631BC1D06E00FDC81F /* Products */ = { - isa = PBXGroup; - children = ( - 8D2949621BC1D06E00FDC81F /* SavingForever.app */, - ); - name = Products; - sourceTree = ""; - }; - 8D2949641BC1D06E00FDC81F /* SavingForever */ = { - isa = PBXGroup; - children = ( - 8D2949681BC1D06E00FDC81F /* AppDelegate.h */, - 8D2949691BC1D06E00FDC81F /* AppDelegate.m */, - 8D29496B1BC1D06E00FDC81F /* ViewController.h */, - 8D29496C1BC1D06E00FDC81F /* ViewController.m */, - 8D29496E1BC1D06E00FDC81F /* Main.storyboard */, - 8D2949741BC1D06E00FDC81F /* Assets.xcassets */, - 8D2949761BC1D06E00FDC81F /* LaunchScreen.storyboard */, - 8D2949791BC1D06E00FDC81F /* Info.plist */, - 8D2949711BC1D06E00FDC81F /* SavingForever.xcdatamodeld */, - 8D2949651BC1D06E00FDC81F /* Supporting Files */, - ); - path = SavingForever; - sourceTree = ""; - }; - 8D2949651BC1D06E00FDC81F /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 8D2949661BC1D06E00FDC81F /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D2949611BC1D06E00FDC81F /* SavingForever */ = { - isa = PBXNativeTarget; - buildConfigurationList = 8D29497C1BC1D06E00FDC81F /* Build configuration list for PBXNativeTarget "SavingForever" */; - buildPhases = ( - 8D29495E1BC1D06E00FDC81F /* Sources */, - 8D29495F1BC1D06E00FDC81F /* Frameworks */, - 8D2949601BC1D06E00FDC81F /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SavingForever; - productName = SavingForever; - productReference = 8D2949621BC1D06E00FDC81F /* SavingForever.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 8D29495A1BC1D06D00FDC81F /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0700; - ORGANIZATIONNAME = "Michael Kavouras"; - TargetAttributes = { - 8D2949611BC1D06E00FDC81F = { - CreatedOnToolsVersion = 7.0.1; - }; - }; - }; - buildConfigurationList = 8D29495D1BC1D06D00FDC81F /* Build configuration list for PBXProject "SavingForever" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 8D2949591BC1D06D00FDC81F; - productRefGroup = 8D2949631BC1D06E00FDC81F /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D2949611BC1D06E00FDC81F /* SavingForever */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D2949601BC1D06E00FDC81F /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D2949781BC1D06E00FDC81F /* LaunchScreen.storyboard in Resources */, - 8D2949751BC1D06E00FDC81F /* Assets.xcassets in Resources */, - 8D2949701BC1D06E00FDC81F /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D29495E1BC1D06E00FDC81F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D29496D1BC1D06E00FDC81F /* ViewController.m in Sources */, - 8D29496A1BC1D06E00FDC81F /* AppDelegate.m in Sources */, - 8D2949671BC1D06E00FDC81F /* main.m in Sources */, - 8D2949731BC1D06E00FDC81F /* SavingForever.xcdatamodeld in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 8D29496E1BC1D06E00FDC81F /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 8D29496F1BC1D06E00FDC81F /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 8D2949761BC1D06E00FDC81F /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 8D2949771BC1D06E00FDC81F /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 8D29497A1BC1D06E00FDC81F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 8D29497B1BC1D06E00FDC81F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 8D29497D1BC1D06E00FDC81F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SavingForever/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.SavingForever; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 8D29497E1BC1D06E00FDC81F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SavingForever/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.SavingForever; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 8D29495D1BC1D06D00FDC81F /* Build configuration list for PBXProject "SavingForever" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 8D29497A1BC1D06E00FDC81F /* Debug */, - 8D29497B1BC1D06E00FDC81F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 8D29497C1BC1D06E00FDC81F /* Build configuration list for PBXNativeTarget "SavingForever" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 8D29497D1BC1D06E00FDC81F /* Debug */, - 8D29497E1BC1D06E00FDC81F /* Release */, - ); - defaultConfigurationIsVisible = 0; - }; -/* End XCConfigurationList section */ - -/* Begin XCVersionGroup section */ - 8D2949711BC1D06E00FDC81F /* SavingForever.xcdatamodeld */ = { - isa = XCVersionGroup; - children = ( - 8D2949721BC1D06E00FDC81F /* SavingForever.xcdatamodel */, - ); - currentVersion = 8D2949721BC1D06E00FDC81F /* SavingForever.xcdatamodel */; - path = SavingForever.xcdatamodeld; - sourceTree = ""; - versionGroupType = wrapper.xcdatamodel; - }; -/* End XCVersionGroup section */ - }; - rootObject = 8D29495A1BC1D06D00FDC81F /* Project object */; -} diff --git a/SavingForever/SavingForever/Base.lproj/Main.storyboard b/SavingForever/SavingForever/Base.lproj/Main.storyboard deleted file mode 100644 index f56d2f3..0000000 --- a/SavingForever/SavingForever/Base.lproj/Main.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/SavingForever/SavingForever/SavingForever.xcdatamodeld/SavingForever.xcdatamodel/contents b/SavingForever/SavingForever/SavingForever.xcdatamodeld/SavingForever.xcdatamodel/contents deleted file mode 100644 index 193f33c..0000000 --- a/SavingForever/SavingForever/SavingForever.xcdatamodeld/SavingForever.xcdatamodel/contents +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/SavingForever/SavingForever/ViewController.h b/SavingForever/SavingForever/ViewController.h deleted file mode 100644 index b193f94..0000000 --- a/SavingForever/SavingForever/ViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ViewController.h -// SavingForever -// -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. -// - -#import - -@interface ViewController : UIViewController - - -@end - diff --git a/SavingForever/SavingForever/ViewController.m b/SavingForever/SavingForever/ViewController.m deleted file mode 100644 index 5f1f663..0000000 --- a/SavingForever/SavingForever/ViewController.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// ViewController.m -// SavingForever -// -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. -// - -#import "ViewController.h" - -@interface ViewController () - -@end - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -@end From 101ed7d34c47fbc7defeac814768122f0d1587b6 Mon Sep 17 00:00:00 2001 From: Jamaal Sedayao Date: Tue, 6 Oct 2015 11:13:25 -0400 Subject: [PATCH 2/5] jamaal commit - functionality almost complete --- .DS_Store | Bin 6148 -> 6148 bytes MarsWater/.DS_Store | Bin 6148 -> 6148 bytes MarsWater/List+CoreDataProperties.h | 2 +- MarsWater/List+CoreDataProperties.m | 2 +- MarsWater/MarsWater.xcodeproj/project.pbxproj | 13 ++ MarsWater/MarsWater/.DS_Store | Bin 6148 -> 6148 bytes .../MarsWater/Base.lproj/Main.storyboard | 169 +++++++++++++++++- MarsWater/MarsWater/ListTableViewController.m | 13 ++ .../MarsWater/TaskCreateTableViewController.h | 13 ++ .../MarsWater/TaskCreateTableViewController.m | 69 +++++++ .../MarsWater/TasksTableViewController.h | 21 +++ .../MarsWater/TasksTableViewController.m | 137 ++++++++++++++ 12 files changed, 429 insertions(+), 10 deletions(-) create mode 100644 MarsWater/MarsWater/TaskCreateTableViewController.h create mode 100644 MarsWater/MarsWater/TaskCreateTableViewController.m create mode 100644 MarsWater/MarsWater/TasksTableViewController.h create mode 100644 MarsWater/MarsWater/TasksTableViewController.m diff --git a/.DS_Store b/.DS_Store index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..81f1a70b5abf67dc9efd8c065ea5056c16c427f7 100644 GIT binary patch delta 125 zcmZoMXfc=|&e%3FQEZ}~q9`K+0|O8XFffEOBr=pRq%sth1y4*=pKKt)BG1X-3luD3 zC`Ohn%FD^mO9yG&m>9_pQn#6#gNK8$ZDZnh=E?jbilR(FNd+KI0Ai5&2Y{Giv!lp< FW&p(58ZiI> delta 67 zcmZoMXfc=|&Zs)EP;8=}A_oHyFfuR*Y}^>eKJh@*W_At%4o20D8^1G8<`+@q1WGX^ TfYeMj;Zfe4AhLvcVgm~RE=&+7 diff --git a/MarsWater/.DS_Store b/MarsWater/.DS_Store index 0eccb113f6fc9079db068f53d7f2610663f08aa7..58d15df2ac4432a5e4f2c895ea39758fe28f8f74 100644 GIT binary patch delta 92 zcmZoMXfc=|#>CJ*u~2NHo+2aD!~pBb1|lqzn;F$7n=$e+o&Pksfl-UEAj2>?IX}06 s0R$K~GcvKUZ5Ci+X57rq!OsEI4ix#$Jegm_kda}s4UhEZ7?Bms0CkZU1ONa4 delta 117 zcmZoMXfc=|#>B`mu~2NHo+2a5!~pBb0*nnnMvnzkRp7)PErHy87nhXMl4J&kOXk|2 z7#JX8Dd=JoKkza!Y}m}mD8jaxor9kPXef~Loq009h#?0f0|P??5O4Mn*~1I~)PW!8 diff --git a/MarsWater/List+CoreDataProperties.h b/MarsWater/List+CoreDataProperties.h index 9593078..79c2ee4 100644 --- a/MarsWater/List+CoreDataProperties.h +++ b/MarsWater/List+CoreDataProperties.h @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nullable, nonatomic, retain) NSString *title; @property (nullable, nonatomic, retain) NSDate *createdAt; @property (nullable, nonatomic, retain) id color; -@property (nullable, nonatomic, retain) NSArray *task; +@property (nullable, nonatomic, retain) NSMutableArray *tasks; @end diff --git a/MarsWater/List+CoreDataProperties.m b/MarsWater/List+CoreDataProperties.m index 3ce5172..04fc4ea 100644 --- a/MarsWater/List+CoreDataProperties.m +++ b/MarsWater/List+CoreDataProperties.m @@ -16,6 +16,6 @@ @implementation List (CoreDataProperties) @dynamic title; @dynamic createdAt; @dynamic color; -@dynamic task; +@dynamic tasks; @end diff --git a/MarsWater/MarsWater.xcodeproj/project.pbxproj b/MarsWater/MarsWater.xcodeproj/project.pbxproj index eca0e9e..d0f9d0d 100644 --- a/MarsWater/MarsWater.xcodeproj/project.pbxproj +++ b/MarsWater/MarsWater.xcodeproj/project.pbxproj @@ -19,6 +19,8 @@ 9A0BA1061BC1B32000AEBB43 /* Task.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0BA1021BC1B32000AEBB43 /* Task.m */; settings = {ASSET_TAGS = (); }; }; 9A0BA1091BC1B91200AEBB43 /* ListTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0BA1081BC1B91200AEBB43 /* ListTableViewController.m */; settings = {ASSET_TAGS = (); }; }; 9A0BA10C1BC1B92100AEBB43 /* ListCreationTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A0BA10B1BC1B92100AEBB43 /* ListCreationTableViewController.m */; settings = {ASSET_TAGS = (); }; }; + 9AE7507A1BC3444F00C2312C /* TasksTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AE750791BC3444F00C2312C /* TasksTableViewController.m */; settings = {ASSET_TAGS = (); }; }; + 9AE7507D1BC4014600C2312C /* TaskCreateTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AE7507C1BC4014600C2312C /* TaskCreateTableViewController.m */; settings = {ASSET_TAGS = (); }; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -43,6 +45,10 @@ 9A0BA1081BC1B91200AEBB43 /* ListTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListTableViewController.m; sourceTree = ""; }; 9A0BA10A1BC1B92100AEBB43 /* ListCreationTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListCreationTableViewController.h; sourceTree = ""; }; 9A0BA10B1BC1B92100AEBB43 /* ListCreationTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListCreationTableViewController.m; sourceTree = ""; }; + 9AE750781BC3444F00C2312C /* TasksTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TasksTableViewController.h; sourceTree = ""; }; + 9AE750791BC3444F00C2312C /* TasksTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TasksTableViewController.m; sourceTree = ""; }; + 9AE7507B1BC4014600C2312C /* TaskCreateTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TaskCreateTableViewController.h; sourceTree = ""; }; + 9AE7507C1BC4014600C2312C /* TaskCreateTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaskCreateTableViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -82,6 +88,10 @@ 9A0BA1081BC1B91200AEBB43 /* ListTableViewController.m */, 9A0BA10A1BC1B92100AEBB43 /* ListCreationTableViewController.h */, 9A0BA10B1BC1B92100AEBB43 /* ListCreationTableViewController.m */, + 9AE750781BC3444F00C2312C /* TasksTableViewController.h */, + 9AE750791BC3444F00C2312C /* TasksTableViewController.m */, + 9AE7507B1BC4014600C2312C /* TaskCreateTableViewController.h */, + 9AE7507C1BC4014600C2312C /* TaskCreateTableViewController.m */, 9A0BA0E61BC1AE6100AEBB43 /* Main.storyboard */, 9A0BA0EC1BC1AE6200AEBB43 /* Assets.xcassets */, 9A0BA0EE1BC1AE6200AEBB43 /* LaunchScreen.storyboard */, @@ -189,9 +199,11 @@ 9A0BA0EB1BC1AE6100AEBB43 /* MarsWater.xcdatamodeld in Sources */, 9A0BA1051BC1B32000AEBB43 /* Task+CoreDataProperties.m in Sources */, 9A0BA0E21BC1AE6100AEBB43 /* AppDelegate.m in Sources */, + 9AE7507D1BC4014600C2312C /* TaskCreateTableViewController.m in Sources */, 9A0BA1061BC1B32000AEBB43 /* Task.m in Sources */, 9A0BA1041BC1B32000AEBB43 /* List.m in Sources */, 9A0BA1031BC1B32000AEBB43 /* List+CoreDataProperties.m in Sources */, + 9AE7507A1BC3444F00C2312C /* TasksTableViewController.m in Sources */, 9A0BA10C1BC1B92100AEBB43 /* ListCreationTableViewController.m in Sources */, 9A0BA0DF1BC1AE6100AEBB43 /* main.m in Sources */, 9A0BA1091BC1B91200AEBB43 /* ListTableViewController.m in Sources */, @@ -343,6 +355,7 @@ 9A0BA0F61BC1AE6200AEBB43 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ diff --git a/MarsWater/MarsWater/.DS_Store b/MarsWater/MarsWater/.DS_Store index 2d9ed0800f2e18aa8dd17d58b309d417af666c3a..9fd4a7bb82183441857baeac04c6977a0ee52dbf 100644 GIT binary patch delta 29 jcmZoMXffE}#l*xRKiP-LhRIfZau<^wklK8T$x0LebNmN_ delta 29 jcmZoMXffE}#l*yZbFvSU4U;z8 - + + + + @@ -52,7 +55,7 @@ - + @@ -60,7 +63,49 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -70,7 +115,7 @@ - + @@ -85,7 +130,7 @@ - + @@ -193,7 +238,115 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -210,7 +363,7 @@ - + diff --git a/MarsWater/MarsWater/ListTableViewController.m b/MarsWater/MarsWater/ListTableViewController.m index 3da24e2..b648f98 100644 --- a/MarsWater/MarsWater/ListTableViewController.m +++ b/MarsWater/MarsWater/ListTableViewController.m @@ -10,6 +10,7 @@ #import "ListTableViewController.h" #import "AppDelegate.h" #import "List.h" +#import "TasksTableViewController.h" @interface ListTableViewController () @@ -70,5 +71,17 @@ - (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id) [self.tableView reloadData]; } +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + + if ([[segue identifier] isEqualToString:@"taskSegueIdentifier"]) { + + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + List *list = self.fetchedResultsController.fetchedObjects[indexPath.row]; + TasksTableViewController *viewController = segue.destinationViewController; + + viewController.listName = list.title; + viewController.listColor = (UIColor *)list.color; + } +} @end diff --git a/MarsWater/MarsWater/TaskCreateTableViewController.h b/MarsWater/MarsWater/TaskCreateTableViewController.h new file mode 100644 index 0000000..4a23da4 --- /dev/null +++ b/MarsWater/MarsWater/TaskCreateTableViewController.h @@ -0,0 +1,13 @@ +// +// TaskCreateTableViewController.h +// MarsWater +// +// Created by Jamaal Sedayao on 10/6/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// + +#import + +@interface TaskCreateTableViewController : UITableViewController + +@end diff --git a/MarsWater/MarsWater/TaskCreateTableViewController.m b/MarsWater/MarsWater/TaskCreateTableViewController.m new file mode 100644 index 0000000..2f83b5b --- /dev/null +++ b/MarsWater/MarsWater/TaskCreateTableViewController.m @@ -0,0 +1,69 @@ +// +// TaskCreateTableViewController.m +// MarsWater +// +// Created by Jamaal Sedayao on 10/6/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// + +#import "TaskCreateTableViewController.h" +#import "AppDelegate.h" +#import "Task.h" +#import + +@interface TaskCreateTableViewController () + +@property (nonatomic) Task *task; +@property (strong, nonatomic) IBOutlet UITextField *taskTitleTextField; + +@end + +@implementation TaskCreateTableViewController + +- (void) setupNavBar { + self.navigationItem.title = @"New Task"; + + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; + + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(save)]; +} +- (void)viewDidLoad { + [super viewDidLoad]; + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + self.task = [NSEntityDescription insertNewObjectForEntityForName:@"Task" inManagedObjectContext:delegate.managedObjectContext]; + + NSLog(@"%@",self.task); + + [self setupNavBar]; +} + +- (void) cancel{ + + [self dismissViewControllerAnimated:YES completion:nil]; +} +- (void) save{ + + self.task.taskDescription = self.taskTitleTextField.text; + self.task.createdAt = [NSDate date]; + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + [delegate.managedObjectContext save:nil]; + + [self dismissViewControllerAnimated:YES completion:nil]; +} + + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return 4; +} + +@end diff --git a/MarsWater/MarsWater/TasksTableViewController.h b/MarsWater/MarsWater/TasksTableViewController.h new file mode 100644 index 0000000..374757a --- /dev/null +++ b/MarsWater/MarsWater/TasksTableViewController.h @@ -0,0 +1,21 @@ +// +// TasksTableViewController.h +// MarsWater +// +// Created by Jamaal Sedayao on 10/5/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// + +#import +#import "Task.h" +#import "AppDelegate.h" +#import "ListTableViewController.h" + +@interface TasksTableViewController : UITableViewController + +@property (nonatomic) Task *task; +@property (nonatomic) NSString *listName; +@property (nonatomic) id listColor; + + +@end diff --git a/MarsWater/MarsWater/TasksTableViewController.m b/MarsWater/MarsWater/TasksTableViewController.m new file mode 100644 index 0000000..d585ac4 --- /dev/null +++ b/MarsWater/MarsWater/TasksTableViewController.m @@ -0,0 +1,137 @@ +// +// TasksTableViewController.m +// MarsWater +// +// Created by Jamaal Sedayao on 10/5/15. +// Copyright © 2015 Jamaal Sedayao. All rights reserved. +// + +#import "TasksTableViewController.h" +#import "TaskCreateTableViewController.h" +#import + +#define numberOfStaticCells 1 + +@interface TasksTableViewController () + +@property (nonatomic) NSFetchedResultsController *fetchedResultsController; +@property (nonatomic) NSArray *array; + +@end + +@implementation TasksTableViewController + +- (void) setupNavBar{ + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(createNewTask)]; + + self.navigationItem.title = @"List"; + +} + +- (void)viewDidLoad { + [super viewDidLoad]; + [self setupNavBar]; + [self fetchResults]; +} +- (void) viewDidAppear:(BOOL)animated{ + [self fetchResults]; + + [self.tableView reloadData]; +} + +- (void) fetchResults { + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + //1.create an instance of NSFetchRequest with an entity name + NSFetchRequest *fetchRequest = [[NSFetchRequest alloc]initWithEntityName:@"Task"]; + + //2. create a sort descriptor + NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"createdAt" ascending:NO]; + + //3. set the sortdescriptors on the fetch request + fetchRequest.sortDescriptors = @[sort]; + + //4. create a fetchedResultsController with a fetchRequest and a managedObjectContext + self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:delegate.managedObjectContext sectionNameKeyPath:nil cacheName:nil]; + + self.fetchedResultsController.delegate = self; + + [self.fetchedResultsController performFetch:nil]; + +// [self.tableView reloadData]; + +// NSLog(@"%@",self.fetchedResultsController.fetchedObjects); +} + +- (void)createNewTask{ + + UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; +// TaskCreateTableViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"TaskCreateID"]; +// [self presentViewController:viewController animated:YES completion:nil]; + UINavigationController *navigationController = [storyboard instantiateViewControllerWithIdentifier:@"NavigationID"]; + [self presentViewController:navigationController animated:YES completion:nil]; + + +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.fetchedResultsController.fetchedObjects.count + numberOfStaticCells; +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + UITableViewCell *cell; + + if (indexPath.row < numberOfStaticCells) { + + cell = [tableView dequeueReusableCellWithIdentifier:@"StaticCellIdentifier" forIndexPath:indexPath]; + + cell.textLabel.text = self.listName; + cell.backgroundColor = (UIColor *)self.listColor; + + return cell; + + } else { + + cell = [tableView dequeueReusableCellWithIdentifier:@"DynamicCellIdentifier" forIndexPath:indexPath]; + + Task *task = self.fetchedResultsController.fetchedObjects[indexPath.row - numberOfStaticCells]; + +// NSString *string = [self.array objectAtIndex:indexPath.row - numberOfStaticCells]; +// +// NSLog(@"%@",string); + + cell.textLabel.text = task.taskDescription; + + return cell; + } + +} +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ + + if (indexPath.row < numberOfStaticCells) { + return 60; + } else { + return 44; + } +} + + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end From 4ba3802487ed1cc7404aa971263f8183a49b7cf5 Mon Sep 17 00:00:00 2001 From: Jamaal Sedayao Date: Wed, 7 Oct 2015 16:33:29 -0400 Subject: [PATCH 3/5] update functionality --- MarsWater/List+CoreDataProperties.h | 2 +- MarsWater/MarsWater.xcodeproj/project.pbxproj | 34 +++++++--- MarsWater/MarsWater/.DS_Store | Bin 6148 -> 6148 bytes .../MarsWater/Base.lproj/Main.storyboard | 59 ++++++++++-------- MarsWater/MarsWater/ListTableViewController.m | 18 ++++-- .../MarsWater.xcdatamodel/contents | 2 +- .../MarsWater/TaskCreateTableViewController.h | 3 + .../MarsWater/TaskCreateTableViewController.m | 14 ++++- .../MarsWater/TasksTableViewController.h | 2 + .../MarsWater/TasksTableViewController.m | 39 ++++++------ 10 files changed, 107 insertions(+), 66 deletions(-) diff --git a/MarsWater/List+CoreDataProperties.h b/MarsWater/List+CoreDataProperties.h index 79c2ee4..555b973 100644 --- a/MarsWater/List+CoreDataProperties.h +++ b/MarsWater/List+CoreDataProperties.h @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nullable, nonatomic, retain) NSString *title; @property (nullable, nonatomic, retain) NSDate *createdAt; @property (nullable, nonatomic, retain) id color; -@property (nullable, nonatomic, retain) NSMutableArray *tasks; +@property (nullable, nonatomic, retain) NSOrderedSet *tasks; @end diff --git a/MarsWater/MarsWater.xcodeproj/project.pbxproj b/MarsWater/MarsWater.xcodeproj/project.pbxproj index d0f9d0d..9e5c2e9 100644 --- a/MarsWater/MarsWater.xcodeproj/project.pbxproj +++ b/MarsWater/MarsWater.xcodeproj/project.pbxproj @@ -81,17 +81,11 @@ 9A0BA0DC1BC1AE6100AEBB43 /* MarsWater */ = { isa = PBXGroup; children = ( - 9A0BA0FA1BC1B27100AEBB43 /* Model */, 9A0BA0E01BC1AE6100AEBB43 /* AppDelegate.h */, 9A0BA0E11BC1AE6100AEBB43 /* AppDelegate.m */, - 9A0BA1071BC1B91200AEBB43 /* ListTableViewController.h */, - 9A0BA1081BC1B91200AEBB43 /* ListTableViewController.m */, - 9A0BA10A1BC1B92100AEBB43 /* ListCreationTableViewController.h */, - 9A0BA10B1BC1B92100AEBB43 /* ListCreationTableViewController.m */, - 9AE750781BC3444F00C2312C /* TasksTableViewController.h */, - 9AE750791BC3444F00C2312C /* TasksTableViewController.m */, - 9AE7507B1BC4014600C2312C /* TaskCreateTableViewController.h */, - 9AE7507C1BC4014600C2312C /* TaskCreateTableViewController.m */, + 9A0BA0FA1BC1B27100AEBB43 /* Model */, + 9AE7507E1BC4215E00C2312C /* Lists */, + 9AE7507F1BC4217A00C2312C /* Tasks */, 9A0BA0E61BC1AE6100AEBB43 /* Main.storyboard */, 9A0BA0EC1BC1AE6200AEBB43 /* Assets.xcassets */, 9A0BA0EE1BC1AE6200AEBB43 /* LaunchScreen.storyboard */, @@ -125,6 +119,28 @@ name = Model; sourceTree = ""; }; + 9AE7507E1BC4215E00C2312C /* Lists */ = { + isa = PBXGroup; + children = ( + 9A0BA1071BC1B91200AEBB43 /* ListTableViewController.h */, + 9A0BA1081BC1B91200AEBB43 /* ListTableViewController.m */, + 9A0BA10A1BC1B92100AEBB43 /* ListCreationTableViewController.h */, + 9A0BA10B1BC1B92100AEBB43 /* ListCreationTableViewController.m */, + ); + name = Lists; + sourceTree = ""; + }; + 9AE7507F1BC4217A00C2312C /* Tasks */ = { + isa = PBXGroup; + children = ( + 9AE750781BC3444F00C2312C /* TasksTableViewController.h */, + 9AE750791BC3444F00C2312C /* TasksTableViewController.m */, + 9AE7507B1BC4014600C2312C /* TaskCreateTableViewController.h */, + 9AE7507C1BC4014600C2312C /* TaskCreateTableViewController.m */, + ); + name = Tasks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ diff --git a/MarsWater/MarsWater/.DS_Store b/MarsWater/MarsWater/.DS_Store index 9fd4a7bb82183441857baeac04c6977a0ee52dbf..1dadb1a6a4304b53b421e67d7a13e8f7441afb9a 100644 GIT binary patch delta 24 dcmZoMXffE(&ctlRcYJaelP!qee2U3R6aZ!v2k-y@ delta 24 dcmZoMXffE(&ctkPD?Yi4$reO!KE-4u3IJRd2Iv3) diff --git a/MarsWater/MarsWater/Base.lproj/Main.storyboard b/MarsWater/MarsWater/Base.lproj/Main.storyboard index 8432672..8b26a7a 100644 --- a/MarsWater/MarsWater/Base.lproj/Main.storyboard +++ b/MarsWater/MarsWater/Base.lproj/Main.storyboard @@ -14,11 +14,11 @@ - + - + - + @@ -102,10 +102,17 @@ + + + + + + + - + @@ -238,24 +245,7 @@ - - - - - - - - - - - - - - - - - - + @@ -346,7 +336,7 @@ - + @@ -363,7 +353,7 @@ - + @@ -380,7 +370,26 @@ - + + + + + + + + + + + + + + + + + + + + diff --git a/MarsWater/MarsWater/ListTableViewController.m b/MarsWater/MarsWater/ListTableViewController.m index b648f98..b3302db 100644 --- a/MarsWater/MarsWater/ListTableViewController.m +++ b/MarsWater/MarsWater/ListTableViewController.m @@ -42,6 +42,7 @@ - (void)viewDidLoad { [self.fetchedResultsController performFetch:nil]; [self.tableView reloadData]; + } #pragma mark - Table view data source @@ -74,13 +75,18 @@ - (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id) - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"taskSegueIdentifier"]) { + + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + List *list = self.fetchedResultsController.fetchedObjects[indexPath.row]; + + UINavigationController *navController = segue.destinationViewController; + + TasksTableViewController *viewController = navController.viewControllers[0]; + + viewController.listName = list.title; + viewController.listColor = (UIColor *)list.color; + viewController.list = list; - NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; - List *list = self.fetchedResultsController.fetchedObjects[indexPath.row]; - TasksTableViewController *viewController = segue.destinationViewController; - - viewController.listName = list.title; - viewController.listColor = (UIColor *)list.color; } } diff --git a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents index 5c909c5..b9100e9 100644 --- a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents +++ b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents @@ -16,7 +16,7 @@ - + \ No newline at end of file diff --git a/MarsWater/MarsWater/TaskCreateTableViewController.h b/MarsWater/MarsWater/TaskCreateTableViewController.h index 4a23da4..a3c22ac 100644 --- a/MarsWater/MarsWater/TaskCreateTableViewController.h +++ b/MarsWater/MarsWater/TaskCreateTableViewController.h @@ -7,7 +7,10 @@ // #import +#import "List.h" @interface TaskCreateTableViewController : UITableViewController +@property (nonatomic) List *list; + @end diff --git a/MarsWater/MarsWater/TaskCreateTableViewController.m b/MarsWater/MarsWater/TaskCreateTableViewController.m index 2f83b5b..42c36af 100644 --- a/MarsWater/MarsWater/TaskCreateTableViewController.m +++ b/MarsWater/MarsWater/TaskCreateTableViewController.m @@ -11,16 +11,19 @@ #import "Task.h" #import + @interface TaskCreateTableViewController () @property (nonatomic) Task *task; @property (strong, nonatomic) IBOutlet UITextField *taskTitleTextField; +@property (nonatomic) NSMutableOrderedSet *taskForList; @end @implementation TaskCreateTableViewController - (void) setupNavBar { + self.navigationItem.title = @"New Task"; self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; @@ -30,12 +33,12 @@ - (void) setupNavBar { - (void)viewDidLoad { [super viewDidLoad]; + NSLog(@"List: %@",self.list); + AppDelegate *delegate = [UIApplication sharedApplication].delegate; self.task = [NSEntityDescription insertNewObjectForEntityForName:@"Task" inManagedObjectContext:delegate.managedObjectContext]; - NSLog(@"%@",self.task); - [self setupNavBar]; } @@ -48,6 +51,12 @@ - (void) save{ self.task.taskDescription = self.taskTitleTextField.text; self.task.createdAt = [NSDate date]; + self.taskForList = [[NSMutableOrderedSet alloc]init]; + + self.taskForList = [self.list.tasks mutableCopy]; + + [self.taskForList addObject:self.task]; + AppDelegate *delegate = [UIApplication sharedApplication].delegate; [delegate.managedObjectContext save:nil]; @@ -55,7 +64,6 @@ - (void) save{ [self dismissViewControllerAnimated:YES completion:nil]; } - #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { diff --git a/MarsWater/MarsWater/TasksTableViewController.h b/MarsWater/MarsWater/TasksTableViewController.h index 374757a..cde80b6 100644 --- a/MarsWater/MarsWater/TasksTableViewController.h +++ b/MarsWater/MarsWater/TasksTableViewController.h @@ -10,12 +10,14 @@ #import "Task.h" #import "AppDelegate.h" #import "ListTableViewController.h" +#import "List.h" @interface TasksTableViewController : UITableViewController @property (nonatomic) Task *task; @property (nonatomic) NSString *listName; @property (nonatomic) id listColor; +@property (nonatomic) List *list; @end diff --git a/MarsWater/MarsWater/TasksTableViewController.m b/MarsWater/MarsWater/TasksTableViewController.m index d585ac4..1c1b7b2 100644 --- a/MarsWater/MarsWater/TasksTableViewController.m +++ b/MarsWater/MarsWater/TasksTableViewController.m @@ -9,34 +9,34 @@ #import "TasksTableViewController.h" #import "TaskCreateTableViewController.h" #import +#import "List.h" #define numberOfStaticCells 1 @interface TasksTableViewController () @property (nonatomic) NSFetchedResultsController *fetchedResultsController; -@property (nonatomic) NSArray *array; @end @implementation TasksTableViewController - (void) setupNavBar{ - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(createNewTask)]; - - self.navigationItem.title = @"List"; - +// self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(createNewTask)]; + self.navigationItem.title = @"Tasks"; } - - (void)viewDidLoad { [super viewDidLoad]; [self setupNavBar]; [self fetchResults]; + } - (void) viewDidAppear:(BOOL)animated{ [self fetchResults]; [self.tableView reloadData]; + + // NSLog(@"%@",self.fetchedResultsController.fetchedObjects); } - (void) fetchResults { @@ -59,19 +59,15 @@ - (void) fetchResults { [self.fetchedResultsController performFetch:nil]; // [self.tableView reloadData]; - -// NSLog(@"%@",self.fetchedResultsController.fetchedObjects); } - (void)createNewTask{ - UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; -// TaskCreateTableViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"TaskCreateID"]; -// [self presentViewController:viewController animated:YES completion:nil]; - UINavigationController *navigationController = [storyboard instantiateViewControllerWithIdentifier:@"NavigationID"]; - [self presentViewController:navigationController animated:YES completion:nil]; - - +// UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; +//// TaskCreateTableViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"TaskCreateID"]; +//// [self presentViewController:viewController animated:YES completion:nil]; +// UINavigationController *navigationController = [storyboard instantiateViewControllerWithIdentifier:@"NavigationID"]; +// [self presentViewController:navigationController animated:YES completion:nil]; } #pragma mark - Table view data source @@ -123,15 +119,16 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa } } - -/* #pragma mark - Navigation -// In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - // Get the new view controller using [segue destinationViewController]. - // Pass the selected object to the new view controller. + + if ([[segue identifier]isEqualToString:@"taskCreateSegue"]){ + TaskCreateTableViewController *viewController = segue.destinationViewController; + viewController.list = self.list; + } + } -*/ + @end From 9c766525a84e96dcabceda74ca757688aaae41ef Mon Sep 17 00:00:00 2001 From: Jamaal Sedayao Date: Thu, 8 Oct 2015 20:34:21 -0400 Subject: [PATCH 4/5] functionality complete --- .DS_Store | Bin 6148 -> 8196 bytes MarsWater/.DS_Store | Bin 6148 -> 6148 bytes MarsWater/List+CoreDataProperties.h | 2 +- MarsWater/List+CoreDataProperties.m | 2 +- MarsWater/MarsWater/.DS_Store | Bin 6148 -> 6148 bytes MarsWater/MarsWater/ListTableViewController.h | 3 + MarsWater/MarsWater/ListTableViewController.m | 9 +- .../MarsWater.xcdatamodel/contents | 2 +- .../MarsWater/TaskCreateTableViewController.m | 30 ++++-- .../MarsWater/TasksTableViewController.m | 99 +++++++++++++----- 10 files changed, 109 insertions(+), 38 deletions(-) diff --git a/.DS_Store b/.DS_Store index 81f1a70b5abf67dc9efd8c065ea5056c16c427f7..5950e02ed4a1c2355759ff46b7f02641dd96e173 100644 GIT binary patch literal 8196 zcmeHMTWl0n82-QBn6V>0t);ZfHmnp=YZ@q^2qJWQ2TIe1w)CQ*-Q5{sbUIsiwp-$L z*hjL!9%sU#07>F2% z7>F2%7>F3S85rO@TNY!LdtY0lHew)R;Fe@SejgHCB_=~GYE+*NZd3}uSjNMuaG&!4 z6_W@t8DdeR3gtO<_JA-HVTu7A&h~_KXH14z)TqM=I-C%$j4(riTAkw(%AJtZ7_|`t z5d+H^kh!}_1Dv<#D7Zd&y?%=H09x9C301ms@bUdB$Mew(Z!4VKgQCi%JVk$-A{Cn%aNY z9kVIfrhEKFZlvwhO^0Zj)$t^~L~qk6I!$NjES;nCbb&6?uXKqn(;sw&t^z1Q8Ol+E z4Tz%=E!d77xDPwA2i@pFANFGaM=*v7Okx@?9)*V)%;6b4iz1%KYj_=R;w^lLPjMPw z;wyZM@9;e?;3xcsOSr6eRuWzUbTHg$2)N3fmDM~Os`-tT)g15b+rQ2_c=M|H;##TU zJ8IX}tyiMny|43{E|y5)dPyo3YMCkdEy_y?{6@*2YD_EEUoytJgVU$m1c_ zEGX|y@y$|-!qAV+@fL%RiYQT!R%?8VJP4vxTb00VQzTq8uc-Y#}VKuJgv0)9A3bScp0zYRlI|D@gCmC2lxmlaSET{49?cZw!o{A_o2m1M=?YQZMuWp4ETB)qu~2NHo}wr#0|Nsi1A_nqLpVbsLkUAFLs3fcW=6*4j0zwrP6l6~ za1lc>vUGAzQht68Sthph^3&5P5i*O`Kt&& q^JW3Y=Zu@#Iruq%?f}~Loq009h@k+`84L{&=YW_Dn*&6)FarSNsVk2F delta 122 zcmZoMXfc=|#>CJ*u~2NHo}wrd0|Nsi1A_nqLpVbsLkUAFLlJ}C#6tDS1|lqz7cr>| z^^9qgyO?Z2^yX7cGOU}~IsWnk0CWcyNB{r; delta 64 zcmZoMXfc@JFUrEez`)4BAi%&7&XCAZ!jQ^P#Gtp?ka;;HBg +#import "List.h" @interface ListTableViewController : UITableViewController +@property (nonatomic) List *list; + @end diff --git a/MarsWater/MarsWater/ListTableViewController.m b/MarsWater/MarsWater/ListTableViewController.m index b3302db..a042504 100644 --- a/MarsWater/MarsWater/ListTableViewController.m +++ b/MarsWater/MarsWater/ListTableViewController.m @@ -9,7 +9,6 @@ #import #import "ListTableViewController.h" #import "AppDelegate.h" -#import "List.h" #import "TasksTableViewController.h" @interface ListTableViewController () @@ -77,15 +76,15 @@ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"taskSegueIdentifier"]) { NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; - List *list = self.fetchedResultsController.fetchedObjects[indexPath.row]; + self.list = self.fetchedResultsController.fetchedObjects[indexPath.row]; UINavigationController *navController = segue.destinationViewController; TasksTableViewController *viewController = navController.viewControllers[0]; - viewController.listName = list.title; - viewController.listColor = (UIColor *)list.color; - viewController.list = list; + viewController.listName = self.list.title; + viewController.listColor = (UIColor *)self.list.color; + viewController.list = self.list; } } diff --git a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents index b9100e9..8a47904 100644 --- a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents +++ b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents @@ -16,7 +16,7 @@ - + \ No newline at end of file diff --git a/MarsWater/MarsWater/TaskCreateTableViewController.m b/MarsWater/MarsWater/TaskCreateTableViewController.m index 42c36af..86d9323 100644 --- a/MarsWater/MarsWater/TaskCreateTableViewController.m +++ b/MarsWater/MarsWater/TaskCreateTableViewController.m @@ -33,13 +33,15 @@ - (void) setupNavBar { - (void)viewDidLoad { [super viewDidLoad]; - NSLog(@"List: %@",self.list); + [self setupNavBar]; + +// NSLog(@"List: %@",self.list); + self.taskForList = [[NSMutableOrderedSet alloc]init]; AppDelegate *delegate = [UIApplication sharedApplication].delegate; self.task = [NSEntityDescription insertNewObjectForEntityForName:@"Task" inManagedObjectContext:delegate.managedObjectContext]; - [self setupNavBar]; } - (void) cancel{ @@ -49,14 +51,30 @@ - (void) cancel{ - (void) save{ self.task.taskDescription = self.taskTitleTextField.text; - self.task.createdAt = [NSDate date]; - - self.taskForList = [[NSMutableOrderedSet alloc]init]; - self.taskForList = [self.list.tasks mutableCopy]; + if (self.task.createdAt == nil) { + + self.task.createdAt = [NSDate date]; + + }else { + + self.task.updatedAt = [NSDate date]; + } + //create NSMutableOrderedSet in this view controller. I called mine NSMutableOrderedSet *taskForList; + //set mutablecopy of self.list.task.mutableCopy equal to it + self.taskForList = self.list.task.mutableCopy; + + //add self.task to NSMutableOrderedSet created in this view controller [self.taskForList addObject:self.task]; + //set NSOrderedSet (self.list.task) equal to the NSMutableOrderedSet created in this view controller + self.list.task = self.taskForList; + + NSLog(@"self.list.tasks: %@",self.list.task); + + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; [delegate.managedObjectContext save:nil]; diff --git a/MarsWater/MarsWater/TasksTableViewController.m b/MarsWater/MarsWater/TasksTableViewController.m index 1c1b7b2..8987316 100644 --- a/MarsWater/MarsWater/TasksTableViewController.m +++ b/MarsWater/MarsWater/TasksTableViewController.m @@ -22,9 +22,12 @@ @interface TasksTableViewController () @implementation TasksTableViewController - (void) setupNavBar{ -// self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(createNewTask)]; + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; self.navigationItem.title = @"Tasks"; } +- (void) cancel { + [self dismissViewControllerAnimated:YES completion:nil]; +} - (void)viewDidLoad { [super viewDidLoad]; [self setupNavBar]; @@ -36,40 +39,90 @@ - (void) viewDidAppear:(BOOL)animated{ [self.tableView reloadData]; - // NSLog(@"%@",self.fetchedResultsController.fetchedObjects); } - (void) fetchResults { - AppDelegate *delegate = [UIApplication sharedApplication].delegate; - //1.create an instance of NSFetchRequest with an entity name + AppDelegate *delegate = [UIApplication sharedApplication].delegate; NSFetchRequest *fetchRequest = [[NSFetchRequest alloc]initWithEntityName:@"Task"]; - - //2. create a sort descriptor - NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"createdAt" ascending:NO]; - - //3. set the sortdescriptors on the fetch request + NSSortDescriptor *sort = [[NSSortDescriptor alloc]initWithKey:@"taskDescription" ascending:NO]; fetchRequest.sortDescriptors = @[sort]; + fetchRequest.predicate = [NSPredicate predicateWithFormat:@"list.title == %@", self.list.title]; - //4. create a fetchedResultsController with a fetchRequest and a managedObjectContext - self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:delegate.managedObjectContext sectionNameKeyPath:nil cacheName:nil]; + self.fetchedResultsController = [[NSFetchedResultsController alloc]initWithFetchRequest:fetchRequest managedObjectContext:delegate.managedObjectContext sectionNameKeyPath:nil cacheName:nil]; self.fetchedResultsController.delegate = self; [self.fetchedResultsController performFetch:nil]; -// [self.tableView reloadData]; -} - -- (void)createNewTask{ + NSLog(@"Fetched Results: %@", self.fetchedResultsController.fetchedObjects); + + [self.tableView reloadData]; -// UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; -//// TaskCreateTableViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"TaskCreateID"]; -//// [self presentViewController:viewController animated:YES completion:nil]; -// UINavigationController *navigationController = [storyboard instantiateViewControllerWithIdentifier:@"NavigationID"]; -// [self presentViewController:navigationController animated:YES completion:nil]; } +//- (void) fetchResults { +// AppDelegate *delegate = [UIApplication sharedApplication].delegate; +// +// //1.create an instance of NSFetchRequest with an entity name +// NSFetchRequest *fetchRequest = [[NSFetchRequest alloc]initWithEntityName:@"List"]; +// +// //[fetchRequest valueForKey:@"task"]; +// +//// NSLog(@"fetch request: %@",fetchRequest); +// +// //2. create a sort descriptor +// NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"title" ascending:NO]; +// +//// NSPredicate *taskPredicate = [NSPredicate predicateWithFormat:@"task == %@", self.task]; +//// +//// [fetchRequest setPredicate:taskPredicate]; +// +// //3. set the sortdescriptors on the fetch request +// fetchRequest.sortDescriptors = @[sort]; +// +// //4. create a fetchedResultsController with a fetchRequest and a managedObjectContext +// self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:delegate.managedObjectContext sectionNameKeyPath:nil cacheName:nil]; +// +// self.fetchedResultsController.delegate = self; +// +// [self.fetchedResultsController performFetch:nil]; +// +// +// NSArray *arrayOfLists = self.fetchedResultsController.fetchedObjects; +// NSLog(@"Array Of Lists: %@",arrayOfLists); +// +// NSLog(@"This List: %@",self.list); +// +// // for arrayOfLists +// +// for (List *list in arrayOfLists) { +// if (self.list == list){ +// self.list = list; +// NSLog(@"Extracted List: %@",list); +// } +//} +// +// for (List *task in [self.list valueForKey:@"task"]) { +// NSLog(@"name = %@", [Task valueForKey:@"taskDescription"]); +// } +// +// // NSLog(@"Task Array: %@",self.list.task); +// +//// NSOrderedSet *task = self.list.task; +//// +//// NSLog(@"TASK ORDERED SET: %@",task); +// +// +//// NSLog(@"*********"); +//// NSLog(@"FETCHED RESULTS: %@",self.fetchedResultsController.fetchedObjects); +//// NSLog(@"*********"); +// +// //NSLog(@"THIS LIST: %@", self.list); +// +// [self.tableView reloadData]; +//} + #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { @@ -99,13 +152,10 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell = [tableView dequeueReusableCellWithIdentifier:@"DynamicCellIdentifier" forIndexPath:indexPath]; Task *task = self.fetchedResultsController.fetchedObjects[indexPath.row - numberOfStaticCells]; - -// NSString *string = [self.array objectAtIndex:indexPath.row - numberOfStaticCells]; -// -// NSLog(@"%@",string); cell.textLabel.text = task.taskDescription; + return cell; } @@ -126,6 +176,7 @@ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier]isEqualToString:@"taskCreateSegue"]){ TaskCreateTableViewController *viewController = segue.destinationViewController; viewController.list = self.list; + NSLog(@"passing this list: %@", self.list); } } From 99b0a95cc88764189c7c3ee6452835f0cf516583 Mon Sep 17 00:00:00 2001 From: Jamaal Sedayao Date: Fri, 9 Oct 2015 00:08:52 -0400 Subject: [PATCH 5/5] updated functionality. complete --- MarsWater/.DS_Store | Bin 6148 -> 6148 bytes .../MarsWater/Base.lproj/Main.storyboard | 124 +++++++++++++----- MarsWater/MarsWater/ListTableViewController.m | 4 +- .../MarsWater/TaskCreateTableViewController.m | 15 +-- .../MarsWater/TasksTableViewController.m | 3 +- 5 files changed, 103 insertions(+), 43 deletions(-) diff --git a/MarsWater/.DS_Store b/MarsWater/.DS_Store index 193f7823dd1e43d5fd860e1832a5258eeed3790c..bc88238ebe17ed1cf0bcdb3330f18beb4535d3f7 100644 GIT binary patch delta 19 bcmZoMXffE3%*6C>)8zR~I-4gl6^jA@Ov(pd delta 19 acmZoMXffE3%*6Cxaq@g7oy`-OibVlOD+bO0 diff --git a/MarsWater/MarsWater/Base.lproj/Main.storyboard b/MarsWater/MarsWater/Base.lproj/Main.storyboard index 8b26a7a..6b52d6d 100644 --- a/MarsWater/MarsWater/Base.lproj/Main.storyboard +++ b/MarsWater/MarsWater/Base.lproj/Main.storyboard @@ -42,7 +42,7 @@ - + @@ -85,12 +85,30 @@ - - + + - + + + + + @@ -112,7 +130,7 @@ - + @@ -291,28 +309,88 @@ - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + + + + + + + + - + @@ -331,12 +409,13 @@ + - + @@ -372,24 +451,5 @@ - - - - - - - - - - - - - - - - - - - diff --git a/MarsWater/MarsWater/ListTableViewController.m b/MarsWater/MarsWater/ListTableViewController.m index a042504..b0927c4 100644 --- a/MarsWater/MarsWater/ListTableViewController.m +++ b/MarsWater/MarsWater/ListTableViewController.m @@ -78,9 +78,9 @@ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; self.list = self.fetchedResultsController.fetchedObjects[indexPath.row]; - UINavigationController *navController = segue.destinationViewController; + // UINavigationController *navController = segue.destinationViewController; - TasksTableViewController *viewController = navController.viewControllers[0]; + TasksTableViewController *viewController = segue.destinationViewController; viewController.listName = self.list.title; viewController.listColor = (UIColor *)self.list.color; diff --git a/MarsWater/MarsWater/TaskCreateTableViewController.m b/MarsWater/MarsWater/TaskCreateTableViewController.m index 86d9323..dfc1463 100644 --- a/MarsWater/MarsWater/TaskCreateTableViewController.m +++ b/MarsWater/MarsWater/TaskCreateTableViewController.m @@ -17,6 +17,7 @@ @interface TaskCreateTableViewController () @property (nonatomic) Task *task; @property (strong, nonatomic) IBOutlet UITextField *taskTitleTextField; @property (nonatomic) NSMutableOrderedSet *taskForList; +@property (strong, nonatomic) IBOutlet UIDatePicker *datePicker; @end @@ -26,8 +27,6 @@ - (void) setupNavBar { self.navigationItem.title = @"New Task"; - self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(save)]; } - (void)viewDidLoad { @@ -35,7 +34,8 @@ - (void)viewDidLoad { [self setupNavBar]; -// NSLog(@"List: %@",self.list); + self.datePicker.minimumDate = [NSDate date]; + self.taskForList = [[NSMutableOrderedSet alloc]init]; AppDelegate *delegate = [UIApplication sharedApplication].delegate; @@ -44,13 +44,12 @@ - (void)viewDidLoad { } -- (void) cancel{ - - [self dismissViewControllerAnimated:YES completion:nil]; -} - (void) save{ self.task.taskDescription = self.taskTitleTextField.text; + self.task.dueAt = [self.datePicker date]; + + NSLog(@"Due Date: %@", self.task.dueAt); if (self.task.createdAt == nil) { @@ -79,7 +78,7 @@ - (void) save{ [delegate.managedObjectContext save:nil]; - [self dismissViewControllerAnimated:YES completion:nil]; + [self.navigationController popViewControllerAnimated:YES]; } #pragma mark - Table view data source diff --git a/MarsWater/MarsWater/TasksTableViewController.m b/MarsWater/MarsWater/TasksTableViewController.m index 8987316..18a5ee5 100644 --- a/MarsWater/MarsWater/TasksTableViewController.m +++ b/MarsWater/MarsWater/TasksTableViewController.m @@ -22,7 +22,7 @@ @interface TasksTableViewController () @implementation TasksTableViewController - (void) setupNavBar{ - self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; +// self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; self.navigationItem.title = @"Tasks"; } - (void) cancel { @@ -155,6 +155,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell.textLabel.text = task.taskDescription; + cell.detailTextLabel.text = [NSString stringWithFormat:@"Due Date:%@",task.dueAt]; return cell; }