diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..07b255c Binary files /dev/null and b/.DS_Store differ diff --git a/MarsWater/.DS_Store b/MarsWater/.DS_Store new file mode 100644 index 0000000..98a3017 Binary files /dev/null and b/MarsWater/.DS_Store differ diff --git a/MarsWater/MarsWater.xcodeproj/project.pbxproj b/MarsWater/MarsWater.xcodeproj/project.pbxproj index a2f82e3..941d14c 100644 --- a/MarsWater/MarsWater.xcodeproj/project.pbxproj +++ b/MarsWater/MarsWater.xcodeproj/project.pbxproj @@ -7,46 +7,52 @@ objects = { /* Begin PBXBuildFile section */ - 8DA86CA91BC1AE57006C50BC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CA81BC1AE57006C50BC /* main.m */; }; - 8DA86CAC1BC1AE57006C50BC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CAB1BC1AE57006C50BC /* AppDelegate.m */; }; - 8DA86CB21BC1AE57006C50BC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DA86CB01BC1AE57006C50BC /* Main.storyboard */; }; - 8DA86CB51BC1AE57006C50BC /* MarsWater.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CB31BC1AE57006C50BC /* MarsWater.xcdatamodeld */; }; - 8DA86CB71BC1AE57006C50BC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8DA86CB61BC1AE57006C50BC /* Assets.xcassets */; }; - 8DA86CBA1BC1AE57006C50BC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8DA86CB81BC1AE57006C50BC /* LaunchScreen.storyboard */; }; - 8DA86CD41BC1B8E4006C50BC /* ListsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CD31BC1B8E4006C50BC /* ListsTableViewController.m */; }; - 8DA86CD71BC1B904006C50BC /* ListCreationTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DA86CD61BC1B904006C50BC /* ListCreationTableViewController.m */; }; - 8DB2F6E71BC1E75500E58E65 /* List.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DB2F6E01BC1E75500E58E65 /* List.m */; }; - 8DB2F6E81BC1E75500E58E65 /* List+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DB2F6E21BC1E75500E58E65 /* List+CoreDataProperties.m */; }; - 8DB2F6E91BC1E75500E58E65 /* Task.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DB2F6E41BC1E75500E58E65 /* Task.m */; }; - 8DB2F6EA1BC1E75500E58E65 /* Task+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DB2F6E61BC1E75500E58E65 /* Task+CoreDataProperties.m */; }; + 15191AF61BC5F5A40037E691 /* TasksDetailTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 15191AF51BC5F5A40037E691 /* TasksDetailTableViewController.m */; settings = {ASSET_TAGS = (); }; }; + 15CC83541BC88D7F009809BB /* TaskCreationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 15CC83531BC88D7F009809BB /* TaskCreationViewController.m */; settings = {ASSET_TAGS = (); }; }; + 15DFA3E01BC1AE3F00E18289 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 15DFA3DF1BC1AE3F00E18289 /* main.m */; }; + 15DFA3E31BC1AE3F00E18289 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 15DFA3E21BC1AE3F00E18289 /* AppDelegate.m */; }; + 15DFA3E91BC1AE3F00E18289 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 15DFA3E71BC1AE3F00E18289 /* Main.storyboard */; }; + 15DFA3EC1BC1AE3F00E18289 /* MarsWater.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 15DFA3EA1BC1AE3F00E18289 /* MarsWater.xcdatamodeld */; }; + 15DFA3EE1BC1AE3F00E18289 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 15DFA3ED1BC1AE3F00E18289 /* Assets.xcassets */; }; + 15DFA3F11BC1AE3F00E18289 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 15DFA3EF1BC1AE3F00E18289 /* LaunchScreen.storyboard */; }; + 15DFA4031BC1B31D00E18289 /* Task+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 15DFA3FC1BC1B31D00E18289 /* Task+CoreDataProperties.m */; }; + 15DFA4041BC1B31D00E18289 /* Task.m in Sources */ = {isa = PBXBuildFile; fileRef = 15DFA3FE1BC1B31D00E18289 /* Task.m */; }; + 15DFA4051BC1B31D00E18289 /* List+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 15DFA4001BC1B31D00E18289 /* List+CoreDataProperties.m */; }; + 15DFA4061BC1B31D00E18289 /* List.m in Sources */ = {isa = PBXBuildFile; fileRef = 15DFA4021BC1B31D00E18289 /* List.m */; }; + 15DFA40A1BC1B8E700E18289 /* ListsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 15DFA4091BC1B8E700E18289 /* ListsTableViewController.m */; }; + 15DFA40D1BC1B91400E18289 /* ListCreationTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 15DFA40C1BC1B91400E18289 /* ListCreationTableViewController.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 8DA86CA41BC1AE57006C50BC /* MarsWater.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MarsWater.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 8DA86CA81BC1AE57006C50BC /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 8DA86CAA1BC1AE57006C50BC /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 8DA86CAB1BC1AE57006C50BC /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 8DA86CB11BC1AE57006C50BC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 8DA86CB41BC1AE57006C50BC /* MarsWater.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MarsWater.xcdatamodel; sourceTree = ""; }; - 8DA86CB61BC1AE57006C50BC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 8DA86CB91BC1AE57006C50BC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 8DA86CBB1BC1AE57006C50BC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8DA86CD21BC1B8E4006C50BC /* ListsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListsTableViewController.h; sourceTree = ""; }; - 8DA86CD31BC1B8E4006C50BC /* ListsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListsTableViewController.m; sourceTree = ""; }; - 8DA86CD51BC1B904006C50BC /* ListCreationTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListCreationTableViewController.h; sourceTree = ""; }; - 8DA86CD61BC1B904006C50BC /* ListCreationTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListCreationTableViewController.m; sourceTree = ""; }; - 8DB2F6DF1BC1E75500E58E65 /* List.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = List.h; sourceTree = ""; }; - 8DB2F6E01BC1E75500E58E65 /* List.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = List.m; sourceTree = ""; }; - 8DB2F6E11BC1E75500E58E65 /* List+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "List+CoreDataProperties.h"; sourceTree = ""; }; - 8DB2F6E21BC1E75500E58E65 /* List+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "List+CoreDataProperties.m"; sourceTree = ""; }; - 8DB2F6E31BC1E75500E58E65 /* Task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Task.h; sourceTree = ""; }; - 8DB2F6E41BC1E75500E58E65 /* Task.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Task.m; sourceTree = ""; }; - 8DB2F6E51BC1E75500E58E65 /* Task+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Task+CoreDataProperties.h"; sourceTree = ""; }; - 8DB2F6E61BC1E75500E58E65 /* Task+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Task+CoreDataProperties.m"; sourceTree = ""; }; + 15191AF41BC5F5A40037E691 /* TasksDetailTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TasksDetailTableViewController.h; sourceTree = ""; }; + 15191AF51BC5F5A40037E691 /* TasksDetailTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TasksDetailTableViewController.m; sourceTree = ""; }; + 15CC83521BC88D7F009809BB /* TaskCreationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TaskCreationViewController.h; sourceTree = ""; }; + 15CC83531BC88D7F009809BB /* TaskCreationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaskCreationViewController.m; sourceTree = ""; }; + 15DFA3DB1BC1AE3F00E18289 /* MarsWater.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MarsWater.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 15DFA3DF1BC1AE3F00E18289 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 15DFA3E11BC1AE3F00E18289 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 15DFA3E21BC1AE3F00E18289 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 15DFA3E81BC1AE3F00E18289 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 15DFA3EB1BC1AE3F00E18289 /* MarsWater.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = MarsWater.xcdatamodel; sourceTree = ""; }; + 15DFA3ED1BC1AE3F00E18289 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 15DFA3F01BC1AE3F00E18289 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 15DFA3F21BC1AE3F00E18289 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 15DFA3FB1BC1B31D00E18289 /* Task+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Task+CoreDataProperties.h"; sourceTree = ""; }; + 15DFA3FC1BC1B31D00E18289 /* Task+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Task+CoreDataProperties.m"; sourceTree = ""; }; + 15DFA3FD1BC1B31D00E18289 /* Task.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Task.h; sourceTree = ""; }; + 15DFA3FE1BC1B31D00E18289 /* Task.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Task.m; sourceTree = ""; }; + 15DFA3FF1BC1B31D00E18289 /* List+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "List+CoreDataProperties.h"; sourceTree = ""; }; + 15DFA4001BC1B31D00E18289 /* List+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "List+CoreDataProperties.m"; sourceTree = ""; }; + 15DFA4011BC1B31D00E18289 /* List.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = List.h; sourceTree = ""; }; + 15DFA4021BC1B31D00E18289 /* List.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = List.m; sourceTree = ""; }; + 15DFA4081BC1B8E700E18289 /* ListsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListsTableViewController.h; sourceTree = ""; }; + 15DFA4091BC1B8E700E18289 /* ListsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListsTableViewController.m; sourceTree = ""; }; + 15DFA40B1BC1B91400E18289 /* ListCreationTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListCreationTableViewController.h; sourceTree = ""; }; + 15DFA40C1BC1B91400E18289 /* ListCreationTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ListCreationTableViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 8DA86CA11BC1AE57006C50BC /* Frameworks */ = { + 15DFA3D81BC1AE3F00E18289 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( @@ -56,61 +62,65 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 8DA86C9B1BC1AE57006C50BC = { + 15DFA3D21BC1AE3F00E18289 = { isa = PBXGroup; children = ( - 8DA86CA61BC1AE57006C50BC /* MarsWater */, - 8DA86CA51BC1AE57006C50BC /* Products */, + 15DFA3DD1BC1AE3F00E18289 /* MarsWater */, + 15DFA3DC1BC1AE3F00E18289 /* Products */, ); sourceTree = ""; }; - 8DA86CA51BC1AE57006C50BC /* Products */ = { + 15DFA3DC1BC1AE3F00E18289 /* Products */ = { isa = PBXGroup; children = ( - 8DA86CA41BC1AE57006C50BC /* MarsWater.app */, + 15DFA3DB1BC1AE3F00E18289 /* MarsWater.app */, ); name = Products; sourceTree = ""; }; - 8DA86CA61BC1AE57006C50BC /* MarsWater */ = { + 15DFA3DD1BC1AE3F00E18289 /* MarsWater */ = { isa = PBXGroup; children = ( - 8DA86CD11BC1B329006C50BC /* Model */, - 8DA86CAA1BC1AE57006C50BC /* AppDelegate.h */, - 8DA86CAB1BC1AE57006C50BC /* AppDelegate.m */, - 8DA86CD21BC1B8E4006C50BC /* ListsTableViewController.h */, - 8DA86CD31BC1B8E4006C50BC /* ListsTableViewController.m */, - 8DA86CD51BC1B904006C50BC /* ListCreationTableViewController.h */, - 8DA86CD61BC1B904006C50BC /* ListCreationTableViewController.m */, - 8DA86CB01BC1AE57006C50BC /* Main.storyboard */, - 8DA86CB61BC1AE57006C50BC /* Assets.xcassets */, - 8DA86CB81BC1AE57006C50BC /* LaunchScreen.storyboard */, - 8DA86CBB1BC1AE57006C50BC /* Info.plist */, - 8DA86CB31BC1AE57006C50BC /* MarsWater.xcdatamodeld */, - 8DA86CA71BC1AE57006C50BC /* Supporting Files */, + 15DFA4071BC1B37B00E18289 /* Model */, + 15DFA3E11BC1AE3F00E18289 /* AppDelegate.h */, + 15DFA3E21BC1AE3F00E18289 /* AppDelegate.m */, + 15DFA4081BC1B8E700E18289 /* ListsTableViewController.h */, + 15DFA4091BC1B8E700E18289 /* ListsTableViewController.m */, + 15DFA40B1BC1B91400E18289 /* ListCreationTableViewController.h */, + 15DFA40C1BC1B91400E18289 /* ListCreationTableViewController.m */, + 15191AF41BC5F5A40037E691 /* TasksDetailTableViewController.h */, + 15191AF51BC5F5A40037E691 /* TasksDetailTableViewController.m */, + 15CC83521BC88D7F009809BB /* TaskCreationViewController.h */, + 15CC83531BC88D7F009809BB /* TaskCreationViewController.m */, + 15DFA3E71BC1AE3F00E18289 /* Main.storyboard */, + 15DFA3ED1BC1AE3F00E18289 /* Assets.xcassets */, + 15DFA3EF1BC1AE3F00E18289 /* LaunchScreen.storyboard */, + 15DFA3F21BC1AE3F00E18289 /* Info.plist */, + 15DFA3EA1BC1AE3F00E18289 /* MarsWater.xcdatamodeld */, + 15DFA3DE1BC1AE3F00E18289 /* Supporting Files */, ); path = MarsWater; sourceTree = ""; }; - 8DA86CA71BC1AE57006C50BC /* Supporting Files */ = { + 15DFA3DE1BC1AE3F00E18289 /* Supporting Files */ = { isa = PBXGroup; children = ( - 8DA86CA81BC1AE57006C50BC /* main.m */, + 15DFA3DF1BC1AE3F00E18289 /* main.m */, ); name = "Supporting Files"; sourceTree = ""; }; - 8DA86CD11BC1B329006C50BC /* Model */ = { + 15DFA4071BC1B37B00E18289 /* Model */ = { isa = PBXGroup; children = ( - 8DB2F6DF1BC1E75500E58E65 /* List.h */, - 8DB2F6E01BC1E75500E58E65 /* List.m */, - 8DB2F6E11BC1E75500E58E65 /* List+CoreDataProperties.h */, - 8DB2F6E21BC1E75500E58E65 /* List+CoreDataProperties.m */, - 8DB2F6E31BC1E75500E58E65 /* Task.h */, - 8DB2F6E41BC1E75500E58E65 /* Task.m */, - 8DB2F6E51BC1E75500E58E65 /* Task+CoreDataProperties.h */, - 8DB2F6E61BC1E75500E58E65 /* Task+CoreDataProperties.m */, + 15DFA3FB1BC1B31D00E18289 /* Task+CoreDataProperties.h */, + 15DFA3FC1BC1B31D00E18289 /* Task+CoreDataProperties.m */, + 15DFA3FD1BC1B31D00E18289 /* Task.h */, + 15DFA3FE1BC1B31D00E18289 /* Task.m */, + 15DFA3FF1BC1B31D00E18289 /* List+CoreDataProperties.h */, + 15DFA4001BC1B31D00E18289 /* List+CoreDataProperties.m */, + 15DFA4011BC1B31D00E18289 /* List.h */, + 15DFA4021BC1B31D00E18289 /* List.m */, ); name = Model; sourceTree = ""; @@ -118,13 +128,13 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 8DA86CA31BC1AE57006C50BC /* MarsWater */ = { + 15DFA3DA1BC1AE3F00E18289 /* MarsWater */ = { isa = PBXNativeTarget; - buildConfigurationList = 8DA86CBE1BC1AE57006C50BC /* Build configuration list for PBXNativeTarget "MarsWater" */; + buildConfigurationList = 15DFA3F51BC1AE3F00E18289 /* Build configuration list for PBXNativeTarget "MarsWater" */; buildPhases = ( - 8DA86CA01BC1AE57006C50BC /* Sources */, - 8DA86CA11BC1AE57006C50BC /* Frameworks */, - 8DA86CA21BC1AE57006C50BC /* Resources */, + 15DFA3D71BC1AE3F00E18289 /* Sources */, + 15DFA3D81BC1AE3F00E18289 /* Frameworks */, + 15DFA3D91BC1AE3F00E18289 /* Resources */, ); buildRules = ( ); @@ -132,24 +142,25 @@ ); name = MarsWater; productName = MarsWater; - productReference = 8DA86CA41BC1AE57006C50BC /* MarsWater.app */; + productReference = 15DFA3DB1BC1AE3F00E18289 /* MarsWater.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 8DA86C9C1BC1AE57006C50BC /* Project object */ = { + 15DFA3D31BC1AE3F00E18289 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0700; - ORGANIZATIONNAME = "Michael Kavouras"; + LastUpgradeCheck = 0710; + ORGANIZATIONNAME = myApps; TargetAttributes = { - 8DA86CA31BC1AE57006C50BC = { - CreatedOnToolsVersion = 7.0.1; + 15DFA3DA1BC1AE3F00E18289 = { + CreatedOnToolsVersion = 7.1; + DevelopmentTeam = 4CANNPDNTE; }; }; }; - buildConfigurationList = 8DA86C9F1BC1AE57006C50BC /* Build configuration list for PBXProject "MarsWater" */; + buildConfigurationList = 15DFA3D61BC1AE3F00E18289 /* Build configuration list for PBXProject "MarsWater" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -157,61 +168,63 @@ en, Base, ); - mainGroup = 8DA86C9B1BC1AE57006C50BC; - productRefGroup = 8DA86CA51BC1AE57006C50BC /* Products */; + mainGroup = 15DFA3D21BC1AE3F00E18289; + productRefGroup = 15DFA3DC1BC1AE3F00E18289 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - 8DA86CA31BC1AE57006C50BC /* MarsWater */, + 15DFA3DA1BC1AE3F00E18289 /* MarsWater */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 8DA86CA21BC1AE57006C50BC /* Resources */ = { + 15DFA3D91BC1AE3F00E18289 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8DA86CBA1BC1AE57006C50BC /* LaunchScreen.storyboard in Resources */, - 8DA86CB71BC1AE57006C50BC /* Assets.xcassets in Resources */, - 8DA86CB21BC1AE57006C50BC /* Main.storyboard in Resources */, + 15DFA3F11BC1AE3F00E18289 /* LaunchScreen.storyboard in Resources */, + 15DFA3EE1BC1AE3F00E18289 /* Assets.xcassets in Resources */, + 15DFA3E91BC1AE3F00E18289 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 8DA86CA01BC1AE57006C50BC /* Sources */ = { + 15DFA3D71BC1AE3F00E18289 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8DA86CB51BC1AE57006C50BC /* MarsWater.xcdatamodeld in Sources */, - 8DA86CAC1BC1AE57006C50BC /* AppDelegate.m in Sources */, - 8DB2F6EA1BC1E75500E58E65 /* Task+CoreDataProperties.m in Sources */, - 8DA86CD41BC1B8E4006C50BC /* ListsTableViewController.m in Sources */, - 8DB2F6E71BC1E75500E58E65 /* List.m in Sources */, - 8DB2F6E91BC1E75500E58E65 /* Task.m in Sources */, - 8DA86CD71BC1B904006C50BC /* ListCreationTableViewController.m in Sources */, - 8DA86CA91BC1AE57006C50BC /* main.m in Sources */, - 8DB2F6E81BC1E75500E58E65 /* List+CoreDataProperties.m in Sources */, + 15DFA3EC1BC1AE3F00E18289 /* MarsWater.xcdatamodeld in Sources */, + 15DFA4031BC1B31D00E18289 /* Task+CoreDataProperties.m in Sources */, + 15191AF61BC5F5A40037E691 /* TasksDetailTableViewController.m in Sources */, + 15DFA3E31BC1AE3F00E18289 /* AppDelegate.m in Sources */, + 15CC83541BC88D7F009809BB /* TaskCreationViewController.m in Sources */, + 15DFA40A1BC1B8E700E18289 /* ListsTableViewController.m in Sources */, + 15DFA4041BC1B31D00E18289 /* Task.m in Sources */, + 15DFA4061BC1B31D00E18289 /* List.m in Sources */, + 15DFA40D1BC1B91400E18289 /* ListCreationTableViewController.m in Sources */, + 15DFA3E01BC1AE3F00E18289 /* main.m in Sources */, + 15DFA4051BC1B31D00E18289 /* List+CoreDataProperties.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ - 8DA86CB01BC1AE57006C50BC /* Main.storyboard */ = { + 15DFA3E71BC1AE3F00E18289 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( - 8DA86CB11BC1AE57006C50BC /* Base */, + 15DFA3E81BC1AE3F00E18289 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; - 8DA86CB81BC1AE57006C50BC /* LaunchScreen.storyboard */ = { + 15DFA3EF1BC1AE3F00E18289 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( - 8DA86CB91BC1AE57006C50BC /* Base */, + 15DFA3F01BC1AE3F00E18289 /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; @@ -219,7 +232,7 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 8DA86CBC1BC1AE57006C50BC /* Debug */ = { + 15DFA3F31BC1AE3F00E18289 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -255,14 +268,14 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; }; name = Debug; }; - 8DA86CBD1BC1AE57006C50BC /* Release */ = { + 15DFA3F41BC1AE3F00E18289 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -292,52 +305,56 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; name = Release; }; - 8DA86CBF1BC1AE57006C50BC /* Debug */ = { + 15DFA3F61BC1AE3F00E18289 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = MarsWater/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.MarsWater; + PRODUCT_BUNDLE_IDENTIFIER = com.ericsze.MarsWater; PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = 1; }; name = Debug; }; - 8DA86CC01BC1AE57006C50BC /* Release */ = { + 15DFA3F71BC1AE3F00E18289 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = MarsWater/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mikekavouras.MarsWater; + PRODUCT_BUNDLE_IDENTIFIER = com.ericsze.MarsWater; PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = 1; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 8DA86C9F1BC1AE57006C50BC /* Build configuration list for PBXProject "MarsWater" */ = { + 15DFA3D61BC1AE3F00E18289 /* Build configuration list for PBXProject "MarsWater" */ = { isa = XCConfigurationList; buildConfigurations = ( - 8DA86CBC1BC1AE57006C50BC /* Debug */, - 8DA86CBD1BC1AE57006C50BC /* Release */, + 15DFA3F31BC1AE3F00E18289 /* Debug */, + 15DFA3F41BC1AE3F00E18289 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 8DA86CBE1BC1AE57006C50BC /* Build configuration list for PBXNativeTarget "MarsWater" */ = { + 15DFA3F51BC1AE3F00E18289 /* Build configuration list for PBXNativeTarget "MarsWater" */ = { isa = XCConfigurationList; buildConfigurations = ( - 8DA86CBF1BC1AE57006C50BC /* Debug */, - 8DA86CC01BC1AE57006C50BC /* Release */, + 15DFA3F61BC1AE3F00E18289 /* Debug */, + 15DFA3F71BC1AE3F00E18289 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -345,17 +362,17 @@ /* End XCConfigurationList section */ /* Begin XCVersionGroup section */ - 8DA86CB31BC1AE57006C50BC /* MarsWater.xcdatamodeld */ = { + 15DFA3EA1BC1AE3F00E18289 /* MarsWater.xcdatamodeld */ = { isa = XCVersionGroup; children = ( - 8DA86CB41BC1AE57006C50BC /* MarsWater.xcdatamodel */, + 15DFA3EB1BC1AE3F00E18289 /* MarsWater.xcdatamodel */, ); - currentVersion = 8DA86CB41BC1AE57006C50BC /* MarsWater.xcdatamodel */; + currentVersion = 15DFA3EB1BC1AE3F00E18289 /* MarsWater.xcdatamodel */; path = MarsWater.xcdatamodeld; sourceTree = ""; versionGroupType = wrapper.xcdatamodel; }; /* End XCVersionGroup section */ }; - rootObject = 8DA86C9C1BC1AE57006C50BC /* Project object */; + rootObject = 15DFA3D31BC1AE3F00E18289 /* Project object */; } diff --git a/MarsWater/MarsWater/.DS_Store b/MarsWater/MarsWater/.DS_Store new file mode 100644 index 0000000..cc1fbd3 Binary files /dev/null and b/MarsWater/MarsWater/.DS_Store differ diff --git a/MarsWater/MarsWater/AppDelegate.h b/MarsWater/MarsWater/AppDelegate.h index 33642bf..922471d 100644 --- a/MarsWater/MarsWater/AppDelegate.h +++ b/MarsWater/MarsWater/AppDelegate.h @@ -2,8 +2,8 @@ // AppDelegate.h // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Eric Sze on 10/4/15. +// Copyright © 2015 myApps. All rights reserved. // #import diff --git a/MarsWater/MarsWater/AppDelegate.m b/MarsWater/MarsWater/AppDelegate.m index 8e592d7..cdb072e 100644 --- a/MarsWater/MarsWater/AppDelegate.m +++ b/MarsWater/MarsWater/AppDelegate.m @@ -2,8 +2,8 @@ // AppDelegate.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Eric Sze on 10/4/15. +// Copyright © 2015 myApps. 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.MarsWater" 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.ericsze.MarsWater" in the application's documents directory. return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; } diff --git a/MarsWater/MarsWater/Base.lproj/Main.storyboard b/MarsWater/MarsWater/Base.lproj/Main.storyboard index 13ead89..e6c4515 100644 --- a/MarsWater/MarsWater/Base.lproj/Main.storyboard +++ b/MarsWater/MarsWater/Base.lproj/Main.storyboard @@ -1,36 +1,148 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - + - - + + - + + + - - + + - - + + - + - - - - - - - - - - - - - - - - - - + - + - + - - + + - + - + - - + + - - + + - - - - - - - + + + + + + + + + + + + - - + + - - + + - - - - + - - - - - - - - - + + + + + + + + + + + + + + - + + + + + + + + + + + + + + - - + + - + + + - + - + - + - + - - + + - + - + - + diff --git a/MarsWater/MarsWater/List+CoreDataProperties.h b/MarsWater/MarsWater/List+CoreDataProperties.h index 9ce8d06..8919f8a 100644 --- a/MarsWater/MarsWater/List+CoreDataProperties.h +++ b/MarsWater/MarsWater/List+CoreDataProperties.h @@ -2,8 +2,8 @@ // List+CoreDataProperties.h // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Eric Sze on 10/4/15. +// Copyright © 2015 myApps. All rights reserved. // // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu // to delete and recreate this implementation file for your updated model. @@ -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) NSOrderedSet *task; @end diff --git a/MarsWater/MarsWater/List+CoreDataProperties.m b/MarsWater/MarsWater/List+CoreDataProperties.m index 6c70870..7c5ff37 100644 --- a/MarsWater/MarsWater/List+CoreDataProperties.m +++ b/MarsWater/MarsWater/List+CoreDataProperties.m @@ -2,8 +2,8 @@ // List+CoreDataProperties.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Eric Sze on 10/4/15. +// Copyright © 2015 myApps. All rights reserved. // // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu // to delete and recreate this implementation file for your updated model. diff --git a/MarsWater/MarsWater/List.h b/MarsWater/MarsWater/List.h index d7c69f2..f9d6ba6 100644 --- a/MarsWater/MarsWater/List.h +++ b/MarsWater/MarsWater/List.h @@ -2,13 +2,15 @@ // List.h // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Eric Sze on 10/4/15. +// Copyright © 2015 myApps. All rights reserved. // #import #import +@class Task; + NS_ASSUME_NONNULL_BEGIN @interface List : NSManagedObject diff --git a/MarsWater/MarsWater/List.m b/MarsWater/MarsWater/List.m index 5edadfa..fa53ad4 100644 --- a/MarsWater/MarsWater/List.m +++ b/MarsWater/MarsWater/List.m @@ -2,11 +2,12 @@ // List.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Eric Sze on 10/4/15. +// Copyright © 2015 myApps. All rights reserved. // #import "List.h" +#import "Task.h" @implementation List diff --git a/MarsWater/MarsWater/ListCreationTableViewController.h b/MarsWater/MarsWater/ListCreationTableViewController.h index df226d4..0229bb7 100644 --- a/MarsWater/MarsWater/ListCreationTableViewController.h +++ b/MarsWater/MarsWater/ListCreationTableViewController.h @@ -2,8 +2,8 @@ // ListCreationTableViewController.h // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Eric Sze on 10/4/15. +// Copyright © 2015 myApps. All rights reserved. // #import diff --git a/MarsWater/MarsWater/ListCreationTableViewController.m b/MarsWater/MarsWater/ListCreationTableViewController.m index 0ecf6e9..b445179 100644 --- a/MarsWater/MarsWater/ListCreationTableViewController.m +++ b/MarsWater/MarsWater/ListCreationTableViewController.m @@ -2,10 +2,9 @@ // ListCreationTableViewController.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Eric Sze on 10/4/15. +// Copyright © 2015 myApps. All rights reserved. // - #import #import "ListCreationTableViewController.h" #import "List.h" @@ -14,7 +13,6 @@ @interface ListCreationTableViewController () @property (weak, nonatomic) IBOutlet UITextField *titleTextField; - @property (nonatomic) List *list; @end @@ -26,20 +24,24 @@ - (void)viewDidLoad { [self setupNavigationBar]; + // gives us access to this class: AppDelegate AppDelegate *delegate = [UIApplication sharedApplication].delegate; + // insertNewObject: take the entity you want by listing it as a string // take managedObjectContext from AppDelegate self.list = [NSEntityDescription insertNewObjectForEntityForName:@"List" inManagedObjectContext:delegate.managedObjectContext]; + +// NSLog(@"%@", self.list); } - (void)setupNavigationBar { + // set the title + // set the left bar to cancel + // set the right button to save 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)]; - - // set the right button to save } - (void)cancel { @@ -47,17 +49,26 @@ - (void)cancel { } - (void)save { + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + self.list.title = self.titleTextField.text; self.list.createdAt = [NSDate date]; - AppDelegate *delegate = [UIApplication sharedApplication].delegate; [delegate.managedObjectContext save:nil]; + + NSLog(@"%@", self.list); + + if (self.list.color == nil) { + self.list.color = [UIColor colorWithRed:0.363368 green:0.694405 blue:0.180309 alpha:1]; + } + [self dismissViewControllerAnimated:YES completion:nil]; } - (IBAction)colorButtonTapped:(UIButton *)sender { self.list.color = sender.backgroundColor; + } @end diff --git a/MarsWater/MarsWater/ListsTableViewController.h b/MarsWater/MarsWater/ListsTableViewController.h index e83a1d1..fad370a 100644 --- a/MarsWater/MarsWater/ListsTableViewController.h +++ b/MarsWater/MarsWater/ListsTableViewController.h @@ -2,8 +2,8 @@ // ListsTableViewController.h // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Eric Sze on 10/4/15. +// Copyright © 2015 myApps. All rights reserved. // #import diff --git a/MarsWater/MarsWater/ListsTableViewController.m b/MarsWater/MarsWater/ListsTableViewController.m index 8a2659c..52d5f90 100644 --- a/MarsWater/MarsWater/ListsTableViewController.m +++ b/MarsWater/MarsWater/ListsTableViewController.m @@ -2,14 +2,14 @@ // ListsTableViewController.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Eric Sze on 10/4/15. +// Copyright © 2015 myApps. All rights reserved. // - #import #import "ListsTableViewController.h" #import "AppDelegate.h" #import "List.h" +#import "TasksDetailTableViewController.h" @interface ListsTableViewController () @@ -22,30 +22,33 @@ @implementation ListsTableViewController - (void)viewDidLoad { [super viewDidLoad]; - AppDelegate *delegate = [UIApplication sharedApplication].delegate; - // 1) create an instance of NSFetchRequest with an entity name + // Steps to create a fetch request: + // 1) Create an instance of NSFetchRequest with the entity name in .xcdatamodeld NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"List"]; - - // 2) create a sort descriptor + // 2) Specify criteria for filtering which objects to fetch Create a sort descriptor NSSortDescriptor *sort = [[NSSortDescriptor alloc] initWithKey:@"createdAt" ascending:NO]; - // 3) set the sortDescriptors on the fetchRequest + // 3) Specify how the fetched objects should be sorted // Set the sortDescriptors on the fetchRequest fetchRequest.sortDescriptors = @[sort]; - // 4) create a fetchedResultsController with a fetchRequest and a managedObjectContext, + // 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; + // 5) Perform the fetch [self.fetchedResultsController performFetch:nil]; + // after you fetch, you want to reload the data [self.tableView reloadData]; + } + #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { @@ -56,21 +59,49 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger return self.fetchedResultsController.fetchedObjects.count; } + - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: @"ListCellIdentifier" forIndexPath:indexPath]; + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ListCellIdentifier" forIndexPath:indexPath]; List *list = self.fetchedResultsController.fetchedObjects[indexPath.row]; - cell.backgroundColor = (UIColor *)list.color; cell.textLabel.text = list.title; cell.detailTextLabel.text = [list.createdAt description]; - + cell.backgroundColor = (UIColor *)list.color; + return cell; } + - (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath { - + [self.tableView reloadData]; + +} + + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + if ([segue.identifier isEqualToString:@"tasksDetailSegue"]) { + NSIndexPath *indexPath = self.tableView.indexPathForSelectedRow; + + TasksDetailTableViewController *tasksDetailTVC = segue.destinationViewController; + + tasksDetailTVC.list = self.fetchedResultsController.fetchedObjects[indexPath.row]; + } +} + + +// Delete cells from UITableView +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (editingStyle == UITableViewCellEditingStyleDelete) { + // takes entire dictionary + List *list = self.fetchedResultsController.fetchedObjects[indexPath.row]; + // set the delegate + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + [delegate.managedObjectContext deleteObject:list]; + [delegate.managedObjectContext save:nil]; + } } -@end +@end diff --git a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents index 116441d..9775835 100644 --- a/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents +++ b/MarsWater/MarsWater/MarsWater.xcdatamodeld/MarsWater.xcdatamodel/contents @@ -12,11 +12,11 @@ - + - - + + \ No newline at end of file diff --git a/MarsWater/MarsWater/Task+CoreDataProperties.h b/MarsWater/MarsWater/Task+CoreDataProperties.h index 2cc11d7..0bbd1b7 100644 --- a/MarsWater/MarsWater/Task+CoreDataProperties.h +++ b/MarsWater/MarsWater/Task+CoreDataProperties.h @@ -2,8 +2,8 @@ // Task+CoreDataProperties.h // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Eric Sze on 10/4/15. +// Copyright © 2015 myApps. All rights reserved. // // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu // to delete and recreate this implementation file for your updated model. @@ -18,10 +18,10 @@ NS_ASSUME_NONNULL_BEGIN @property (nullable, nonatomic, retain) NSString *taskDescription; @property (nullable, nonatomic, retain) NSDate *createdAt; @property (nullable, nonatomic, retain) NSDate *dueAt; -@property (nullable, nonatomic, retain) NSDate *updatedAt; +@property (nullable, nonatomic, retain) NSDate *updateAt; @property (nullable, nonatomic, retain) NSNumber *priority; @property (nullable, nonatomic, retain) NSDate *completedAt; -@property (nullable, nonatomic, retain) List *list; +@property (nullable, nonatomic, retain) NSManagedObject *list; @end diff --git a/MarsWater/MarsWater/Task+CoreDataProperties.m b/MarsWater/MarsWater/Task+CoreDataProperties.m index 1ea972c..7d44286 100644 --- a/MarsWater/MarsWater/Task+CoreDataProperties.m +++ b/MarsWater/MarsWater/Task+CoreDataProperties.m @@ -2,8 +2,8 @@ // Task+CoreDataProperties.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Eric Sze on 10/4/15. +// Copyright © 2015 myApps. All rights reserved. // // Choose "Create NSManagedObject Subclass…" from the Core Data editor menu // to delete and recreate this implementation file for your updated model. @@ -16,7 +16,7 @@ @implementation Task (CoreDataProperties) @dynamic taskDescription; @dynamic createdAt; @dynamic dueAt; -@dynamic updatedAt; +@dynamic updateAt; @dynamic priority; @dynamic completedAt; @dynamic list; diff --git a/MarsWater/MarsWater/Task.h b/MarsWater/MarsWater/Task.h index e714efc..91db12e 100644 --- a/MarsWater/MarsWater/Task.h +++ b/MarsWater/MarsWater/Task.h @@ -2,15 +2,13 @@ // Task.h // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Eric Sze on 10/4/15. +// Copyright © 2015 myApps. All rights reserved. // #import #import -@class List; - NS_ASSUME_NONNULL_BEGIN @interface Task : NSManagedObject diff --git a/MarsWater/MarsWater/Task.m b/MarsWater/MarsWater/Task.m index c32ed42..f735b73 100644 --- a/MarsWater/MarsWater/Task.m +++ b/MarsWater/MarsWater/Task.m @@ -2,12 +2,11 @@ // Task.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Eric Sze on 10/4/15. +// Copyright © 2015 myApps. All rights reserved. // #import "Task.h" -#import "List.h" @implementation Task diff --git a/MarsWater/MarsWater/TaskCreationViewController.h b/MarsWater/MarsWater/TaskCreationViewController.h new file mode 100644 index 0000000..89f8bea --- /dev/null +++ b/MarsWater/MarsWater/TaskCreationViewController.h @@ -0,0 +1,18 @@ +// +// TaskCreationViewController.h +// MarsWater +// +// Created by Eric Sze on 10/9/15. +// Copyright © 2015 myApps. All rights reserved. +// + +#import +#import "List.h" +#import "AppDelegate.h" +#import "Task.h" + +@interface TaskCreationViewController : UIViewController + +@property (nonatomic) List *list; + +@end diff --git a/MarsWater/MarsWater/TaskCreationViewController.m b/MarsWater/MarsWater/TaskCreationViewController.m new file mode 100644 index 0000000..70554b0 --- /dev/null +++ b/MarsWater/MarsWater/TaskCreationViewController.m @@ -0,0 +1,69 @@ +// +// TaskCreationViewController.m +// MarsWater +// +// Created by Eric Sze on 10/9/15. +// Copyright © 2015 myApps. All rights reserved. +// + +#import "TaskCreationViewController.h" + + + +@interface TaskCreationViewController () + +@property (nonatomic) Task *task; +@property (nonatomic, weak) IBOutlet UITextField *taskTextField; +@property (nonatomic) NSMutableOrderedSet *listTasks; + +@end + +@implementation TaskCreationViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self setupNavigationBar]; + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + self.task = [NSEntityDescription insertNewObjectForEntityForName:@"Task" inManagedObjectContext:delegate.managedObjectContext]; +} + +- (void)setupNavigationBar { + // set the title + // set the left bar to cancel + // set the right button to add task + + self.navigationItem.title = @"Create 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)cancel { + [self dismissViewControllerAnimated:YES completion:nil]; +} + +- (void)save { + + AppDelegate *delegate = [UIApplication sharedApplication].delegate; + + if (self.taskTextField.text.length != 0) { + self.task.taskDescription = self.taskTextField.text; + self.task.createdAt = [NSDate date]; + self.task.list = self.list; + + [delegate.managedObjectContext save:nil]; + + [self dismissViewControllerAnimated:YES completion:nil]; + } + + NSLog(@"%@", self.task.taskDescription); +} + + + + + +@end \ No newline at end of file diff --git a/MarsWater/MarsWater/TasksDetailTableViewController.h b/MarsWater/MarsWater/TasksDetailTableViewController.h new file mode 100644 index 0000000..50663bd --- /dev/null +++ b/MarsWater/MarsWater/TasksDetailTableViewController.h @@ -0,0 +1,21 @@ +// +// TasksDetailTableViewController.h +// MarsWater +// +// Created by Eric Sze on 10/7/15. +// Copyright © 2015 myApps. All rights reserved. +// + +#import +#import "List.h" +#import "AppDelegate.h" +#import "Task.h" +#import "ListsTableViewController.h" +#import "TaskCreationViewController.h" + +@interface TasksDetailTableViewController : UITableViewController + +@property (nonatomic) List *list; +//@property (nonatomic) Task *task; + +@end diff --git a/MarsWater/MarsWater/TasksDetailTableViewController.m b/MarsWater/MarsWater/TasksDetailTableViewController.m new file mode 100644 index 0000000..8304717 --- /dev/null +++ b/MarsWater/MarsWater/TasksDetailTableViewController.m @@ -0,0 +1,99 @@ +// +// TasksDetailTableViewController.m +// MarsWater +// +// Created by Eric Sze on 10/7/15. +// Copyright © 2015 myApps. All rights reserved. +// + +#import "TasksDetailTableViewController.h" + +@interface TasksDetailTableViewController () + +@end + +@implementation TasksDetailTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self setupNavigationBar]; +// [self fetchResults]; +} + +-(void)viewWillAppear:(BOOL)animated{ + + [self.tableView reloadData]; +} + +- (void)setupNavigationBar { + // set the title + // set the left bar to cancel + // set the right button to add task + + self.navigationItem.title = @"Tasks"; + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]; + +// self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addTask)]; +} + +- (void)cancel { + [self.navigationController popToRootViewControllerAnimated:YES]; +} + +//- (void)addTask { +// UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; +// +// TaskCreationViewController *taskCreationVC = [storyboard instantiateViewControllerWithIdentifier:@"TaskCreationIdentifier"]; +//// taskCreationVC.list = self.list; +// +// // must instantiate view controller +// UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:taskCreationVC]; +// +// [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.list.task.count; +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"taskCellIdentifier" forIndexPath:indexPath]; + + Task *task = self.list.task[indexPath.row]; + cell.textLabel.text = task.taskDescription; + + return cell; +} + +#pragma mark - segue + +-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ + + UINavigationController *navController = segue.destinationViewController; + TaskCreationViewController *taskCreationVC = (TaskCreationViewController + *)([navController viewControllers][0]); + taskCreationVC.list = self.list; +} + +// +//- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath { +// +// [self.tableView reloadData]; +// +//} + + + + + +@end diff --git a/MarsWater/MarsWater/main.m b/MarsWater/MarsWater/main.m index c107d8b..ecff26d 100644 --- a/MarsWater/MarsWater/main.m +++ b/MarsWater/MarsWater/main.m @@ -1,9 +1,9 @@ - +// // main.m // MarsWater // -// Created by Michael Kavouras on 10/4/15. -// Copyright © 2015 Michael Kavouras. All rights reserved. +// Created by Eric Sze on 10/4/15. +// Copyright © 2015 myApps. All rights reserved. // #import