diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp.xcodeproj/project.pbxproj" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp.xcodeproj/project.pbxproj" new file mode 100644 index 0000000..397d7af --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp.xcodeproj/project.pbxproj" @@ -0,0 +1,553 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 59E7225B1DC0C6B1006A4D20 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E7225A1DC0C6B1006A4D20 /* main.m */; }; + 59E7225E1DC0C6B1006A4D20 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E7225D1DC0C6B1006A4D20 /* AppDelegate.m */; }; + 59E722671DC0C6B1006A4D20 /* myCalendarApp.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 59E722651DC0C6B1006A4D20 /* myCalendarApp.xcdatamodeld */; }; + 59E722691DC0C6B1006A4D20 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 59E722681DC0C6B1006A4D20 /* Assets.xcassets */; }; + 59E7226C1DC0C6B1006A4D20 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 59E7226A1DC0C6B1006A4D20 /* LaunchScreen.storyboard */; }; + 59E722771DC0C6B1006A4D20 /* myCalendarAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E722761DC0C6B1006A4D20 /* myCalendarAppTests.m */; }; + 59E722821DC0C6B1006A4D20 /* myCalendarAppUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E722811DC0C6B1006A4D20 /* myCalendarAppUITests.m */; }; + 59E722901DC0CA4F006A4D20 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E7228F1DC0CA4F006A4D20 /* ViewController.m */; }; + 59E722931DC0CBEA006A4D20 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 59E722911DC0CBEA006A4D20 /* Main.storyboard */; }; + 59E722961DC0CEC9006A4D20 /* calView.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E722951DC0CEC9006A4D20 /* calView.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 59E722731DC0C6B1006A4D20 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 59E7224E1DC0C6B1006A4D20 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 59E722551DC0C6B1006A4D20; + remoteInfo = myCalendarApp; + }; + 59E7227E1DC0C6B1006A4D20 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 59E7224E1DC0C6B1006A4D20 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 59E722551DC0C6B1006A4D20; + remoteInfo = myCalendarApp; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 59E722561DC0C6B1006A4D20 /* myCalendarApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = myCalendarApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 59E7225A1DC0C6B1006A4D20 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 59E7225C1DC0C6B1006A4D20 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 59E7225D1DC0C6B1006A4D20 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 59E7225F1DC0C6B1006A4D20 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 59E722661DC0C6B1006A4D20 /* myCalendarApp.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = myCalendarApp.xcdatamodel; sourceTree = ""; }; + 59E722681DC0C6B1006A4D20 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 59E7226B1DC0C6B1006A4D20 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 59E7226D1DC0C6B1006A4D20 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 59E722721DC0C6B1006A4D20 /* myCalendarAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = myCalendarAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 59E722761DC0C6B1006A4D20 /* myCalendarAppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = myCalendarAppTests.m; sourceTree = ""; }; + 59E722781DC0C6B1006A4D20 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 59E7227D1DC0C6B1006A4D20 /* myCalendarAppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = myCalendarAppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 59E722811DC0C6B1006A4D20 /* myCalendarAppUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = myCalendarAppUITests.m; sourceTree = ""; }; + 59E722831DC0C6B1006A4D20 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 59E7228F1DC0CA4F006A4D20 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ViewController.m; path = ../../../Downloads/Calendar/Calendar/ViewController.m; sourceTree = ""; }; + 59E722921DC0CBEA006A4D20 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = ../../../Downloads/Calendar/Calendar/Base.lproj/Main.storyboard; sourceTree = ""; }; + 59E722941DC0CE95006A4D20 /* calView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = calView.h; sourceTree = ""; }; + 59E722951DC0CEC9006A4D20 /* calView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = calView.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 59E722531DC0C6B1006A4D20 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 59E7226F1DC0C6B1006A4D20 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 59E7227A1DC0C6B1006A4D20 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 59E7224D1DC0C6B1006A4D20 = { + isa = PBXGroup; + children = ( + 59E722581DC0C6B1006A4D20 /* myCalendarApp */, + 59E722751DC0C6B1006A4D20 /* myCalendarAppTests */, + 59E722801DC0C6B1006A4D20 /* myCalendarAppUITests */, + 59E722571DC0C6B1006A4D20 /* Products */, + ); + sourceTree = ""; + }; + 59E722571DC0C6B1006A4D20 /* Products */ = { + isa = PBXGroup; + children = ( + 59E722561DC0C6B1006A4D20 /* myCalendarApp.app */, + 59E722721DC0C6B1006A4D20 /* myCalendarAppTests.xctest */, + 59E7227D1DC0C6B1006A4D20 /* myCalendarAppUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 59E722581DC0C6B1006A4D20 /* myCalendarApp */ = { + isa = PBXGroup; + children = ( + 59E722941DC0CE95006A4D20 /* calView.h */, + 59E722951DC0CEC9006A4D20 /* calView.m */, + 59E722911DC0CBEA006A4D20 /* Main.storyboard */, + 59E7228F1DC0CA4F006A4D20 /* ViewController.m */, + 59E7225C1DC0C6B1006A4D20 /* AppDelegate.h */, + 59E7225D1DC0C6B1006A4D20 /* AppDelegate.m */, + 59E7225F1DC0C6B1006A4D20 /* ViewController.h */, + 59E722681DC0C6B1006A4D20 /* Assets.xcassets */, + 59E7226A1DC0C6B1006A4D20 /* LaunchScreen.storyboard */, + 59E7226D1DC0C6B1006A4D20 /* Info.plist */, + 59E722651DC0C6B1006A4D20 /* myCalendarApp.xcdatamodeld */, + 59E722591DC0C6B1006A4D20 /* Supporting Files */, + ); + path = myCalendarApp; + sourceTree = ""; + }; + 59E722591DC0C6B1006A4D20 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 59E7225A1DC0C6B1006A4D20 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 59E722751DC0C6B1006A4D20 /* myCalendarAppTests */ = { + isa = PBXGroup; + children = ( + 59E722761DC0C6B1006A4D20 /* myCalendarAppTests.m */, + 59E722781DC0C6B1006A4D20 /* Info.plist */, + ); + path = myCalendarAppTests; + sourceTree = ""; + }; + 59E722801DC0C6B1006A4D20 /* myCalendarAppUITests */ = { + isa = PBXGroup; + children = ( + 59E722811DC0C6B1006A4D20 /* myCalendarAppUITests.m */, + 59E722831DC0C6B1006A4D20 /* Info.plist */, + ); + path = myCalendarAppUITests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 59E722551DC0C6B1006A4D20 /* myCalendarApp */ = { + isa = PBXNativeTarget; + buildConfigurationList = 59E722861DC0C6B1006A4D20 /* Build configuration list for PBXNativeTarget "myCalendarApp" */; + buildPhases = ( + 59E722521DC0C6B1006A4D20 /* Sources */, + 59E722531DC0C6B1006A4D20 /* Frameworks */, + 59E722541DC0C6B1006A4D20 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = myCalendarApp; + productName = myCalendarApp; + productReference = 59E722561DC0C6B1006A4D20 /* myCalendarApp.app */; + productType = "com.apple.product-type.application"; + }; + 59E722711DC0C6B1006A4D20 /* myCalendarAppTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 59E722891DC0C6B1006A4D20 /* Build configuration list for PBXNativeTarget "myCalendarAppTests" */; + buildPhases = ( + 59E7226E1DC0C6B1006A4D20 /* Sources */, + 59E7226F1DC0C6B1006A4D20 /* Frameworks */, + 59E722701DC0C6B1006A4D20 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 59E722741DC0C6B1006A4D20 /* PBXTargetDependency */, + ); + name = myCalendarAppTests; + productName = myCalendarAppTests; + productReference = 59E722721DC0C6B1006A4D20 /* myCalendarAppTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 59E7227C1DC0C6B1006A4D20 /* myCalendarAppUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 59E7228C1DC0C6B1006A4D20 /* Build configuration list for PBXNativeTarget "myCalendarAppUITests" */; + buildPhases = ( + 59E722791DC0C6B1006A4D20 /* Sources */, + 59E7227A1DC0C6B1006A4D20 /* Frameworks */, + 59E7227B1DC0C6B1006A4D20 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 59E7227F1DC0C6B1006A4D20 /* PBXTargetDependency */, + ); + name = myCalendarAppUITests; + productName = myCalendarAppUITests; + productReference = 59E7227D1DC0C6B1006A4D20 /* myCalendarAppUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 59E7224E1DC0C6B1006A4D20 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0800; + ORGANIZATIONNAME = "徐欢欢"; + TargetAttributes = { + 59E722551DC0C6B1006A4D20 = { + CreatedOnToolsVersion = 8.0; + ProvisioningStyle = Automatic; + }; + 59E722711DC0C6B1006A4D20 = { + CreatedOnToolsVersion = 8.0; + ProvisioningStyle = Automatic; + TestTargetID = 59E722551DC0C6B1006A4D20; + }; + 59E7227C1DC0C6B1006A4D20 = { + CreatedOnToolsVersion = 8.0; + ProvisioningStyle = Automatic; + TestTargetID = 59E722551DC0C6B1006A4D20; + }; + }; + }; + buildConfigurationList = 59E722511DC0C6B1006A4D20 /* Build configuration list for PBXProject "myCalendarApp" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 59E7224D1DC0C6B1006A4D20; + productRefGroup = 59E722571DC0C6B1006A4D20 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 59E722551DC0C6B1006A4D20 /* myCalendarApp */, + 59E722711DC0C6B1006A4D20 /* myCalendarAppTests */, + 59E7227C1DC0C6B1006A4D20 /* myCalendarAppUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 59E722541DC0C6B1006A4D20 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 59E722931DC0CBEA006A4D20 /* Main.storyboard in Resources */, + 59E7226C1DC0C6B1006A4D20 /* LaunchScreen.storyboard in Resources */, + 59E722691DC0C6B1006A4D20 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 59E722701DC0C6B1006A4D20 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 59E7227B1DC0C6B1006A4D20 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 59E722521DC0C6B1006A4D20 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 59E7225E1DC0C6B1006A4D20 /* AppDelegate.m in Sources */, + 59E7225B1DC0C6B1006A4D20 /* main.m in Sources */, + 59E722901DC0CA4F006A4D20 /* ViewController.m in Sources */, + 59E722671DC0C6B1006A4D20 /* myCalendarApp.xcdatamodeld in Sources */, + 59E722961DC0CEC9006A4D20 /* calView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 59E7226E1DC0C6B1006A4D20 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 59E722771DC0C6B1006A4D20 /* myCalendarAppTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 59E722791DC0C6B1006A4D20 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 59E722821DC0C6B1006A4D20 /* myCalendarAppUITests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 59E722741DC0C6B1006A4D20 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 59E722551DC0C6B1006A4D20 /* myCalendarApp */; + targetProxy = 59E722731DC0C6B1006A4D20 /* PBXContainerItemProxy */; + }; + 59E7227F1DC0C6B1006A4D20 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 59E722551DC0C6B1006A4D20 /* myCalendarApp */; + targetProxy = 59E7227E1DC0C6B1006A4D20 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 59E7226A1DC0C6B1006A4D20 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 59E7226B1DC0C6B1006A4D20 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; + 59E722911DC0CBEA006A4D20 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 59E722921DC0CBEA006A4D20 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 59E722841DC0C6B1006A4D20 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + 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_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + 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 = 10.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 59E722851DC0C6B1006A4D20 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + 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_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + 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 = 10.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 59E722871DC0C6B1006A4D20 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = myCalendarApp/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhh.myCalendarApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 59E722881DC0C6B1006A4D20 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = myCalendarApp/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhh.myCalendarApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 59E7228A1DC0C6B1006A4D20 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = myCalendarAppTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhh.myCalendarAppTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/myCalendarApp.app/myCalendarApp"; + }; + name = Debug; + }; + 59E7228B1DC0C6B1006A4D20 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = myCalendarAppTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhh.myCalendarAppTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/myCalendarApp.app/myCalendarApp"; + }; + name = Release; + }; + 59E7228D1DC0C6B1006A4D20 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = myCalendarAppUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhh.myCalendarAppUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_TARGET_NAME = myCalendarApp; + }; + name = Debug; + }; + 59E7228E1DC0C6B1006A4D20 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = myCalendarAppUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhh.myCalendarAppUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_TARGET_NAME = myCalendarApp; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 59E722511DC0C6B1006A4D20 /* Build configuration list for PBXProject "myCalendarApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 59E722841DC0C6B1006A4D20 /* Debug */, + 59E722851DC0C6B1006A4D20 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 59E722861DC0C6B1006A4D20 /* Build configuration list for PBXNativeTarget "myCalendarApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 59E722871DC0C6B1006A4D20 /* Debug */, + 59E722881DC0C6B1006A4D20 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 59E722891DC0C6B1006A4D20 /* Build configuration list for PBXNativeTarget "myCalendarAppTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 59E7228A1DC0C6B1006A4D20 /* Debug */, + 59E7228B1DC0C6B1006A4D20 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 59E7228C1DC0C6B1006A4D20 /* Build configuration list for PBXNativeTarget "myCalendarAppUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 59E7228D1DC0C6B1006A4D20 /* Debug */, + 59E7228E1DC0C6B1006A4D20 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + +/* Begin XCVersionGroup section */ + 59E722651DC0C6B1006A4D20 /* myCalendarApp.xcdatamodeld */ = { + isa = XCVersionGroup; + children = ( + 59E722661DC0C6B1006A4D20 /* myCalendarApp.xcdatamodel */, + ); + currentVersion = 59E722661DC0C6B1006A4D20 /* myCalendarApp.xcdatamodel */; + path = myCalendarApp.xcdatamodeld; + sourceTree = ""; + versionGroupType = wrapper.xcdatamodel; + }; +/* End XCVersionGroup section */ + }; + rootObject = 59E7224E1DC0C6B1006A4D20 /* Project object */; +} diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/AppDelegate.h" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/AppDelegate.h" new file mode 100644 index 0000000..2b72f47 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/AppDelegate.h" @@ -0,0 +1,21 @@ +// +// AppDelegate.h +// myCalendarApp +// +// Created by 徐欢欢 on 16/10/26. +// Copyright © 2016年 徐欢欢. All rights reserved. +// + +#import +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@property (readonly, strong) NSPersistentContainer *persistentContainer; + +- (void)saveContext; + + +@end diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/AppDelegate.m" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/AppDelegate.m" new file mode 100644 index 0000000..dbe9dab --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/AppDelegate.m" @@ -0,0 +1,98 @@ +// +// AppDelegate.m +// myCalendarApp +// +// Created by 徐欢欢 on 16/10/26. +// Copyright © 2016年 徐欢欢. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. +} + + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. +} + + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + // Saves changes in the application's managed object context before the application terminates. + [self saveContext]; +} + + +#pragma mark - Core Data stack + +@synthesize persistentContainer = _persistentContainer; + +- (NSPersistentContainer *)persistentContainer { + // The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. + @synchronized (self) { + if (_persistentContainer == nil) { + _persistentContainer = [[NSPersistentContainer alloc] initWithName:@"myCalendarApp"]; + [_persistentContainer loadPersistentStoresWithCompletionHandler:^(NSPersistentStoreDescription *storeDescription, NSError *error) { + if (error != nil) { + // Replace this implementation with code to handle the error appropriately. + // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + + /* + Typical reasons for an error here include: + * The parent directory does not exist, cannot be created, or disallows writing. + * The persistent store is not accessible, due to permissions or data protection when the device is locked. + * The device is out of space. + * The store could not be migrated to the current model version. + Check the error message to determine what the actual problem was. + */ + NSLog(@"Unresolved error %@, %@", error, error.userInfo); + abort(); + } + }]; + } + } + + return _persistentContainer; +} + +#pragma mark - Core Data Saving support + +- (void)saveContext { + NSManagedObjectContext *context = self.persistentContainer.viewContext; + NSError *error = nil; + if ([context hasChanges] && ![context save:&error]) { + // Replace this implementation with code to handle the error appropriately. + // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + NSLog(@"Unresolved error %@, %@", error, error.userInfo); + abort(); + } +} + +@end diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/Assets.xcassets/AppIcon.appiconset/Contents.json" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/Assets.xcassets/AppIcon.appiconset/Contents.json" new file mode 100644 index 0000000..1d060ed --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/Assets.xcassets/AppIcon.appiconset/Contents.json" @@ -0,0 +1,93 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "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" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/Base.lproj/LaunchScreen.storyboard" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/Base.lproj/LaunchScreen.storyboard" new file mode 100644 index 0000000..fdf3f97 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/Base.lproj/LaunchScreen.storyboard" @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/Info.plist" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/Info.plist" new file mode 100644 index 0000000..d052473 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/Info.plist" @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/ViewController.h" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/ViewController.h" new file mode 100644 index 0000000..7368bb4 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/ViewController.h" @@ -0,0 +1,34 @@ +// +// ViewController.h +// myCalendarApp +// +// Created by 徐欢欢 on 16/10/26. +// Copyright © 2016年 徐欢欢. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + +//CollectionViewHeader +@interface CalendarHeaderView : UICollectionReusableView +@end + +//UICollectionViewCell +@interface CalendarCell : UICollectionViewCell +@property (weak, nonatomic) UILabel *dayLabel; + +@property (strong, nonatomic) MonthModel *monthModel; +@end + +//存储模型 +@interface MonthModel : NSObject +@property (assign, nonatomic) NSInteger dayValue; +@property (strong, nonatomic) NSDate *dateValue; +@property (assign, nonatomic) BOOL isSelectedDay; +@end + + diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/calView.h" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/calView.h" new file mode 100644 index 0000000..a8323ae --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/calView.h" @@ -0,0 +1,52 @@ +// +// calView.h +// myCalendarApp +// +// Created by 徐欢欢 on 16/10/26. +// Copyright © 2016年 徐欢欢. All rights reserved. +// + +#ifndef calView_h +#define calView_h +@interface NSDate (Formatter) + ++(NSDate *)yesterday; + ++(NSDateFormatter *)formatter; ++(NSDateFormatter *)formatterWithoutTime; ++(NSDateFormatter *)formatterWithoutDate; + +-(NSString *)formatWithUTCTimeZone; +-(NSString *)formatWithLocalTimeZone; +-(NSString *)formatWithTimeZoneOffset:(NSTimeInterval)offset; +-(NSString *)formatWithTimeZone:(NSTimeZone *)timezone; + +-(NSString *)formatWithUTCTimeZoneWithoutTime; +-(NSString *)formatWithLocalTimeZoneWithoutTime; +-(NSString *)formatWithTimeZoneOffsetWithoutTime:(NSTimeInterval)offset; +-(NSString *)formatWithTimeZoneWithoutTime:(NSTimeZone *)timezone; + +-(NSString *)formatWithUTCWithoutDate; +-(NSString *)formatWithLocalTimeWithoutDate; +-(NSString *)formatWithTimeZoneOffsetWithoutDate:(NSTimeInterval)offset; +-(NSString *)formatTimeWithTimeZone:(NSTimeZone *)timezone; + + ++ (NSString *)currentDateStringWithFormat:(NSString *)format; ++ (NSDate *)dateWithSecondsFromNow:(NSInteger)seconds; ++ (NSDate *)dateWithYear:(NSInteger)year month:(NSUInteger)month day:(NSUInteger)day; +- (NSString *)dateWithFormat:(NSString *)format; + +//Other +- (NSString *)mmddByLineWithDate; +- (NSString *)yyyyMMByLineWithDate; +- (NSString *)yyyyMMddByLineWithDate; +- (NSString *)mmddChineseWithDate; +- (NSString *)hhmmssWithDate; + +- (NSString *)morningOrAfterWithHH; +@end + + + +#endif /* calView_h */ diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/calView.m" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/calView.m" new file mode 100644 index 0000000..0af8bf2 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/calView.m" @@ -0,0 +1,182 @@ +// +// calView.m +// myCalendarApp +// +// Created by 徐欢欢 on 16/10/26. +// Copyright © 2016年 徐欢欢. All rights reserved. +// + +#import +@implementation NSDate (Formatter) + ++ (NSDate *)yesterday{ + //获取前一天日期,以秒为单位 + return [NSDate dateWithTimeIntervalSinceNow:-(24*60*60)]; +} + ++(NSDateFormatter *)formatter { + + static NSDateFormatter *formatter = nil; + static dispatch_once_t oncePredicate; + //日期格式 + dispatch_once(&oncePredicate, ^{ + formatter = [[NSDateFormatter alloc] init]; + [formatter setDateStyle:NSDateFormatterMediumStyle]; + [formatter setTimeStyle:NSDateFormatterShortStyle]; + [formatter setDoesRelativeDateFormatting:YES]; + }); + + return formatter; +} + ++(NSDateFormatter *)formatterWithoutTime { + + static NSDateFormatter *formatterWithoutTime = nil; + static dispatch_once_t oncePredicate; + + dispatch_once(&oncePredicate, ^{ + formatterWithoutTime = [[NSDate formatter] copy]; + [formatterWithoutTime setTimeStyle:NSDateFormatterNoStyle]; + }); + + return formatterWithoutTime; +} + ++(NSDateFormatter *)formatterWithoutDate { + + static NSDateFormatter *formatterWithoutDate = nil; + static dispatch_once_t oncePredicate; + + dispatch_once(&oncePredicate, ^{ + formatterWithoutDate = [[NSDate formatter] copy]; + [formatterWithoutDate setDateStyle:NSDateFormatterNoStyle]; + }); + + return formatterWithoutDate; +} + +#pragma mark - +#pragma mark Formatter with date & time +-(NSString *)formatWithUTCTimeZone { + return [self formatWithTimeZoneOffset:0]; +} + +-(NSString *)formatWithLocalTimeZone { + return [self formatWithTimeZone:[NSTimeZone localTimeZone]]; +} + +-(NSString *)formatWithTimeZoneOffset:(NSTimeInterval)offset { + return [self formatWithTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:offset]]; +} + +-(NSString *)formatWithTimeZone:(NSTimeZone *)timezone { + NSDateFormatter *formatter = [NSDate formatter]; + [formatter setTimeZone:timezone]; + return [formatter stringFromDate:self]; +} + +#pragma mark - +#pragma mark Formatter without time +-(NSString *)formatWithUTCTimeZoneWithoutTime { + return [self formatWithTimeZoneOffsetWithoutTime:0]; +} + +-(NSString *)formatWithLocalTimeZoneWithoutTime { + return [self formatWithTimeZoneWithoutTime:[NSTimeZone localTimeZone]]; +} + +-(NSString *)formatWithTimeZoneOffsetWithoutTime:(NSTimeInterval)offset { + return [self formatWithTimeZoneWithoutTime:[NSTimeZone timeZoneForSecondsFromGMT:offset]]; +} + +-(NSString *)formatWithTimeZoneWithoutTime:(NSTimeZone *)timezone { + NSDateFormatter *formatter = [NSDate formatterWithoutTime]; + [formatter setTimeZone:timezone]; + return [formatter stringFromDate:self]; +} + +#pragma mark - +#pragma mark Formatter without date +-(NSString *)formatWithUTCWithoutDate { + return [self formatTimeWithTimeZone:0]; +} +-(NSString *)formatWithLocalTimeWithoutDate { + return [self formatTimeWithTimeZone:[NSTimeZone localTimeZone]]; +} + +-(NSString *)formatWithTimeZoneOffsetWithoutDate:(NSTimeInterval)offset { + return [self formatTimeWithTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:offset]]; +} + +-(NSString *)formatTimeWithTimeZone:(NSTimeZone *)timezone { + NSDateFormatter *formatter = [NSDate formatterWithoutDate]; + [formatter setTimeZone:timezone]; + return [formatter stringFromDate:self]; +} +#pragma mark - +#pragma mark Formatter date ++ (NSString *)currentDateStringWithFormat:(NSString *)format +{ + NSDate *chosenDate = [NSDate date]; + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + [formatter setDateFormat:format]; + NSString *date = [formatter stringFromDate:chosenDate]; + return date; +} ++ (NSDate *)dateWithSecondsFromNow:(NSInteger)seconds { + NSDate *date = [NSDate date]; + NSDateComponents *components = [NSDateComponents new]; + [components setSecond:seconds]; + NSCalendar *calendar = [NSCalendar currentCalendar]; + NSDate *dateSecondsAgo = [calendar dateByAddingComponents:components toDate:date options:0]; + return dateSecondsAgo; +} + ++ (NSDate *)dateWithYear:(NSInteger)year month:(NSUInteger)month day:(NSUInteger)day { + NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; + NSDateComponents *components = [[NSDateComponents alloc] init]; + [components setYear:year]; + [components setMonth:month]; + [components setDay:day]; + return [calendar dateFromComponents:components]; +} +- (NSString *)dateWithFormat:(NSString *)format +{ + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + [formatter setDateFormat:format]; + NSString *date = [formatter stringFromDate:self]; + return date; +} +- (NSString *)yyyyMMByLineWithDate{ + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + [formatter setDateFormat:@"yyyy-MM"]; + return [formatter stringFromDate:self]; +} + +- (NSString *)mmddByLineWithDate{ + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + [formatter setDateFormat:@"MM-dd"]; + return [formatter stringFromDate:self]; +} + +- (NSString *)mmddChineseWithDate{ + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + [formatter setDateFormat:@"MM月dd日"]; + return [formatter stringFromDate:self]; +} + +- (NSString *)hhmmssWithDate{ + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + formatter.timeZone = [NSTimeZone timeZoneWithName:@"GMT"]; + [formatter setDateFormat:@"HH:mm:ss"]; + return [formatter stringFromDate:self]; +} + +- (NSString *)yyyyMMddByLineWithDate{ + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + [formatter setDateFormat:@"yyyy-MM-dd"]; + return [formatter stringFromDate:self]; +} + + +@end diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/main.m" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/main.m" new file mode 100644 index 0000000..672e55d --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/main.m" @@ -0,0 +1,16 @@ +// +// main.m +// myCalendarApp +// +// Created by 徐欢欢 on 16/10/26. +// Copyright © 2016年 徐欢欢. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/myCalendarApp.xcdatamodeld/.xccurrentversion" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/myCalendarApp.xcdatamodeld/.xccurrentversion" new file mode 100644 index 0000000..3b9219c --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/myCalendarApp.xcdatamodeld/.xccurrentversion" @@ -0,0 +1,8 @@ + + + + + _XCCurrentVersionName + myCalendarApp.xcdatamodel + + diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/myCalendarApp.xcdatamodeld/myCalendarApp.xcdatamodel/contents" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/myCalendarApp.xcdatamodeld/myCalendarApp.xcdatamodel/contents" new file mode 100644 index 0000000..ad82c3b --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarApp/myCalendarApp.xcdatamodeld/myCalendarApp.xcdatamodel/contents" @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarAppTests/Info.plist" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarAppTests/Info.plist" new file mode 100644 index 0000000..6c6c23c --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarAppTests/Info.plist" @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarAppTests/myCalendarAppTests.m" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarAppTests/myCalendarAppTests.m" new file mode 100644 index 0000000..73b5daf --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarAppTests/myCalendarAppTests.m" @@ -0,0 +1,39 @@ +// +// myCalendarAppTests.m +// myCalendarAppTests +// +// Created by 徐欢欢 on 16/10/26. +// Copyright © 2016年 徐欢欢. All rights reserved. +// + +#import + +@interface myCalendarAppTests : XCTestCase + +@end + +@implementation myCalendarAppTests + +- (void)setUp { + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. +} + +- (void)testPerformanceExample { + // This is an example of a performance test case. + [self measureBlock:^{ + // Put the code you want to measure the time of here. + }]; +} + +@end diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarAppUITests/Info.plist" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarAppUITests/Info.plist" new file mode 100644 index 0000000..6c6c23c --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarAppUITests/Info.plist" @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarAppUITests/myCalendarAppUITests.m" "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarAppUITests/myCalendarAppUITests.m" new file mode 100644 index 0000000..3bc4cee --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project02/myCalendarApp/myCalendarAppUITests/myCalendarAppUITests.m" @@ -0,0 +1,40 @@ +// +// myCalendarAppUITests.m +// myCalendarAppUITests +// +// Created by 徐欢欢 on 16/10/26. +// Copyright © 2016年 徐欢欢. All rights reserved. +// + +#import + +@interface myCalendarAppUITests : XCTestCase + +@end + +@implementation myCalendarAppUITests + +- (void)setUp { + [super setUp]; + + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + self.continueAfterFailure = NO; + // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. + [[[XCUIApplication alloc] init] launch]; + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample { + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. +} + +@end diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList.xcodeproj/project.pbxproj" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList.xcodeproj/project.pbxproj" new file mode 100644 index 0000000..f5c8a7b --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList.xcodeproj/project.pbxproj" @@ -0,0 +1,547 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 59E722191DC0B89D006A4D20 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E722181DC0B89D006A4D20 /* main.m */; }; + 59E7221C1DC0B89D006A4D20 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E7221B1DC0B89D006A4D20 /* AppDelegate.m */; }; + 59E7221F1DC0B89D006A4D20 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E7221E1DC0B89D006A4D20 /* ViewController.m */; }; + 59E722221DC0B89D006A4D20 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 59E722201DC0B89D006A4D20 /* Main.storyboard */; }; + 59E722251DC0B89D006A4D20 /* TaskList.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 59E722231DC0B89D006A4D20 /* TaskList.xcdatamodeld */; }; + 59E722271DC0B89D006A4D20 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 59E722261DC0B89D006A4D20 /* Assets.xcassets */; }; + 59E7222A1DC0B89D006A4D20 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 59E722281DC0B89D006A4D20 /* LaunchScreen.storyboard */; }; + 59E722351DC0B89D006A4D20 /* TaskListTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E722341DC0B89D006A4D20 /* TaskListTests.m */; }; + 59E722401DC0B89D006A4D20 /* TaskListUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E7223F1DC0B89D006A4D20 /* TaskListUITests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 59E722311DC0B89D006A4D20 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 59E7220C1DC0B89D006A4D20 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 59E722131DC0B89D006A4D20; + remoteInfo = TaskList; + }; + 59E7223C1DC0B89D006A4D20 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 59E7220C1DC0B89D006A4D20 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 59E722131DC0B89D006A4D20; + remoteInfo = TaskList; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 59E722141DC0B89D006A4D20 /* TaskList.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TaskList.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 59E722181DC0B89D006A4D20 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 59E7221A1DC0B89D006A4D20 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 59E7221B1DC0B89D006A4D20 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 59E7221D1DC0B89D006A4D20 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 59E7221E1DC0B89D006A4D20 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 59E722211DC0B89D006A4D20 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 59E722241DC0B89D006A4D20 /* TaskList.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = TaskList.xcdatamodel; sourceTree = ""; }; + 59E722261DC0B89D006A4D20 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 59E722291DC0B89D006A4D20 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 59E7222B1DC0B89D006A4D20 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 59E722301DC0B89D006A4D20 /* TaskListTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TaskListTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 59E722341DC0B89D006A4D20 /* TaskListTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TaskListTests.m; sourceTree = ""; }; + 59E722361DC0B89D006A4D20 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 59E7223B1DC0B89D006A4D20 /* TaskListUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TaskListUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 59E7223F1DC0B89D006A4D20 /* TaskListUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TaskListUITests.m; sourceTree = ""; }; + 59E722411DC0B89D006A4D20 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 59E722111DC0B89D006A4D20 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 59E7222D1DC0B89D006A4D20 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 59E722381DC0B89D006A4D20 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 59E7220B1DC0B89D006A4D20 = { + isa = PBXGroup; + children = ( + 59E722161DC0B89D006A4D20 /* TaskList */, + 59E722331DC0B89D006A4D20 /* TaskListTests */, + 59E7223E1DC0B89D006A4D20 /* TaskListUITests */, + 59E722151DC0B89D006A4D20 /* Products */, + ); + sourceTree = ""; + }; + 59E722151DC0B89D006A4D20 /* Products */ = { + isa = PBXGroup; + children = ( + 59E722141DC0B89D006A4D20 /* TaskList.app */, + 59E722301DC0B89D006A4D20 /* TaskListTests.xctest */, + 59E7223B1DC0B89D006A4D20 /* TaskListUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 59E722161DC0B89D006A4D20 /* TaskList */ = { + isa = PBXGroup; + children = ( + 59E7221A1DC0B89D006A4D20 /* AppDelegate.h */, + 59E7221B1DC0B89D006A4D20 /* AppDelegate.m */, + 59E7221D1DC0B89D006A4D20 /* ViewController.h */, + 59E7221E1DC0B89D006A4D20 /* ViewController.m */, + 59E722201DC0B89D006A4D20 /* Main.storyboard */, + 59E722261DC0B89D006A4D20 /* Assets.xcassets */, + 59E722281DC0B89D006A4D20 /* LaunchScreen.storyboard */, + 59E7222B1DC0B89D006A4D20 /* Info.plist */, + 59E722231DC0B89D006A4D20 /* TaskList.xcdatamodeld */, + 59E722171DC0B89D006A4D20 /* Supporting Files */, + ); + path = TaskList; + sourceTree = ""; + }; + 59E722171DC0B89D006A4D20 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 59E722181DC0B89D006A4D20 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 59E722331DC0B89D006A4D20 /* TaskListTests */ = { + isa = PBXGroup; + children = ( + 59E722341DC0B89D006A4D20 /* TaskListTests.m */, + 59E722361DC0B89D006A4D20 /* Info.plist */, + ); + path = TaskListTests; + sourceTree = ""; + }; + 59E7223E1DC0B89D006A4D20 /* TaskListUITests */ = { + isa = PBXGroup; + children = ( + 59E7223F1DC0B89D006A4D20 /* TaskListUITests.m */, + 59E722411DC0B89D006A4D20 /* Info.plist */, + ); + path = TaskListUITests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 59E722131DC0B89D006A4D20 /* TaskList */ = { + isa = PBXNativeTarget; + buildConfigurationList = 59E722441DC0B89D006A4D20 /* Build configuration list for PBXNativeTarget "TaskList" */; + buildPhases = ( + 59E722101DC0B89D006A4D20 /* Sources */, + 59E722111DC0B89D006A4D20 /* Frameworks */, + 59E722121DC0B89D006A4D20 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TaskList; + productName = TaskList; + productReference = 59E722141DC0B89D006A4D20 /* TaskList.app */; + productType = "com.apple.product-type.application"; + }; + 59E7222F1DC0B89D006A4D20 /* TaskListTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 59E722471DC0B89D006A4D20 /* Build configuration list for PBXNativeTarget "TaskListTests" */; + buildPhases = ( + 59E7222C1DC0B89D006A4D20 /* Sources */, + 59E7222D1DC0B89D006A4D20 /* Frameworks */, + 59E7222E1DC0B89D006A4D20 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 59E722321DC0B89D006A4D20 /* PBXTargetDependency */, + ); + name = TaskListTests; + productName = TaskListTests; + productReference = 59E722301DC0B89D006A4D20 /* TaskListTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 59E7223A1DC0B89D006A4D20 /* TaskListUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 59E7224A1DC0B89D006A4D20 /* Build configuration list for PBXNativeTarget "TaskListUITests" */; + buildPhases = ( + 59E722371DC0B89D006A4D20 /* Sources */, + 59E722381DC0B89D006A4D20 /* Frameworks */, + 59E722391DC0B89D006A4D20 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 59E7223D1DC0B89D006A4D20 /* PBXTargetDependency */, + ); + name = TaskListUITests; + productName = TaskListUITests; + productReference = 59E7223B1DC0B89D006A4D20 /* TaskListUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 59E7220C1DC0B89D006A4D20 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0800; + ORGANIZATIONNAME = "徐欢欢"; + TargetAttributes = { + 59E722131DC0B89D006A4D20 = { + CreatedOnToolsVersion = 8.0; + ProvisioningStyle = Automatic; + }; + 59E7222F1DC0B89D006A4D20 = { + CreatedOnToolsVersion = 8.0; + ProvisioningStyle = Automatic; + TestTargetID = 59E722131DC0B89D006A4D20; + }; + 59E7223A1DC0B89D006A4D20 = { + CreatedOnToolsVersion = 8.0; + ProvisioningStyle = Automatic; + TestTargetID = 59E722131DC0B89D006A4D20; + }; + }; + }; + buildConfigurationList = 59E7220F1DC0B89D006A4D20 /* Build configuration list for PBXProject "TaskList" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 59E7220B1DC0B89D006A4D20; + productRefGroup = 59E722151DC0B89D006A4D20 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 59E722131DC0B89D006A4D20 /* TaskList */, + 59E7222F1DC0B89D006A4D20 /* TaskListTests */, + 59E7223A1DC0B89D006A4D20 /* TaskListUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 59E722121DC0B89D006A4D20 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 59E7222A1DC0B89D006A4D20 /* LaunchScreen.storyboard in Resources */, + 59E722271DC0B89D006A4D20 /* Assets.xcassets in Resources */, + 59E722221DC0B89D006A4D20 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 59E7222E1DC0B89D006A4D20 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 59E722391DC0B89D006A4D20 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 59E722101DC0B89D006A4D20 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 59E722251DC0B89D006A4D20 /* TaskList.xcdatamodeld in Sources */, + 59E7221F1DC0B89D006A4D20 /* ViewController.m in Sources */, + 59E7221C1DC0B89D006A4D20 /* AppDelegate.m in Sources */, + 59E722191DC0B89D006A4D20 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 59E7222C1DC0B89D006A4D20 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 59E722351DC0B89D006A4D20 /* TaskListTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 59E722371DC0B89D006A4D20 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 59E722401DC0B89D006A4D20 /* TaskListUITests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 59E722321DC0B89D006A4D20 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 59E722131DC0B89D006A4D20 /* TaskList */; + targetProxy = 59E722311DC0B89D006A4D20 /* PBXContainerItemProxy */; + }; + 59E7223D1DC0B89D006A4D20 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 59E722131DC0B89D006A4D20 /* TaskList */; + targetProxy = 59E7223C1DC0B89D006A4D20 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 59E722201DC0B89D006A4D20 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 59E722211DC0B89D006A4D20 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 59E722281DC0B89D006A4D20 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 59E722291DC0B89D006A4D20 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 59E722421DC0B89D006A4D20 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + 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_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + 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 = 10.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 59E722431DC0B89D006A4D20 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + 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_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + 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 = 10.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 59E722451DC0B89D006A4D20 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = TaskList/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhh.TaskList; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 59E722461DC0B89D006A4D20 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = TaskList/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhh.TaskList; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 59E722481DC0B89D006A4D20 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = TaskListTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhh.TaskListTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TaskList.app/TaskList"; + }; + name = Debug; + }; + 59E722491DC0B89D006A4D20 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = TaskListTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhh.TaskListTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TaskList.app/TaskList"; + }; + name = Release; + }; + 59E7224B1DC0B89D006A4D20 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = TaskListUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhh.TaskListUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_TARGET_NAME = TaskList; + }; + name = Debug; + }; + 59E7224C1DC0B89D006A4D20 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = TaskListUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.xhh.TaskListUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_TARGET_NAME = TaskList; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 59E7220F1DC0B89D006A4D20 /* Build configuration list for PBXProject "TaskList" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 59E722421DC0B89D006A4D20 /* Debug */, + 59E722431DC0B89D006A4D20 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 59E722441DC0B89D006A4D20 /* Build configuration list for PBXNativeTarget "TaskList" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 59E722451DC0B89D006A4D20 /* Debug */, + 59E722461DC0B89D006A4D20 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 59E722471DC0B89D006A4D20 /* Build configuration list for PBXNativeTarget "TaskListTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 59E722481DC0B89D006A4D20 /* Debug */, + 59E722491DC0B89D006A4D20 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 59E7224A1DC0B89D006A4D20 /* Build configuration list for PBXNativeTarget "TaskListUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 59E7224B1DC0B89D006A4D20 /* Debug */, + 59E7224C1DC0B89D006A4D20 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + +/* Begin XCVersionGroup section */ + 59E722231DC0B89D006A4D20 /* TaskList.xcdatamodeld */ = { + isa = XCVersionGroup; + children = ( + 59E722241DC0B89D006A4D20 /* TaskList.xcdatamodel */, + ); + currentVersion = 59E722241DC0B89D006A4D20 /* TaskList.xcdatamodel */; + path = TaskList.xcdatamodeld; + sourceTree = ""; + versionGroupType = wrapper.xcdatamodel; + }; +/* End XCVersionGroup section */ + }; + rootObject = 59E7220C1DC0B89D006A4D20 /* Project object */; +} diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/AppDelegate.h" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/AppDelegate.h" new file mode 100644 index 0000000..9c6f5b7 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/AppDelegate.h" @@ -0,0 +1,25 @@ +// +// AppDelegate.h +// TaskList +// +// Created by 徐欢欢 on 16/10/26. +// Copyright © 2016年 徐欢欢. All rights reserved. +// + +#import +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@property (readonly, strong) NSPersistentContainer *persistentContainer; + +@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext; +@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel; +@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator; +- (void)saveContext; +- (NSURL *)applicationDocumentsDirectory; + +@end + diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/AppDelegate.m" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/AppDelegate.m" new file mode 100644 index 0000000..bb15986 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/AppDelegate.m" @@ -0,0 +1,160 @@ +// +// AppDelegate.m +// TaskList +// +// Created by 徐欢欢 on 16/10/26. +// Copyright © 2016年 徐欢欢. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. +} + + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. +} + + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + // Saves changes in the application's managed object context before the application terminates. + [self saveContext]; +} + + +#pragma mark - Core Data stack + +@synthesize persistentContainer = _persistentContainer; +@synthesize managedObjectContext = _managedObjectContext; +@synthesize managedObjectModel = _managedObjectModel; +@synthesize persistentStoreCoordinator = _persistentStoreCoordinator; + +- (NSURL *)applicationDocumentsDirectory { + // The directory the application uses to store the Core Data store file. This code uses a directory named "dxq.TaskList" in the application's documents directory. + return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; +} + +- (NSManagedObjectModel *)managedObjectModel { + // The managed object model for the application. It is a fatal error for the application not to be able to find and load its model. + if (_managedObjectModel != nil) { + return _managedObjectModel; + } + NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"TaskList" withExtension:@"momd"]; + _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; + return _managedObjectModel; +} + +- (NSPersistentStoreCoordinator *)persistentStoreCoordinator { + // The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it. + if (_persistentStoreCoordinator != nil) { + return _persistentStoreCoordinator; + } + + // Create the coordinator and store + + _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; + NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"TaskList.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]) { + // Report any error we got. + NSMutableDictionary *dict = [NSMutableDictionary dictionary]; + dict[NSLocalizedDescriptionKey] = @"Failed to initialize the application's saved data"; + dict[NSLocalizedFailureReasonErrorKey] = failureReason; + dict[NSUnderlyingErrorKey] = error; + error = [NSError errorWithDomain:@"YOUR_ERROR_DOMAIN" code:9999 userInfo:dict]; + // Replace this with code to handle the error appropriately. + // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + abort(); + } + + return _persistentStoreCoordinator; +} + + +- (NSPersistentContainer *)persistentContainer { + // The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. + @synchronized (self) { + if (_persistentContainer == nil) { + _persistentContainer = [[NSPersistentContainer alloc] initWithName:@"TaskList"]; + [_persistentContainer loadPersistentStoresWithCompletionHandler:^(NSPersistentStoreDescription *storeDescription, NSError *error) { + if (error != nil) { + // Replace this implementation with code to handle the error appropriately. + // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + + /* + Typical reasons for an error here include: + * The parent directory does not exist, cannot be created, or disallows writing. + * The persistent store is not accessible, due to permissions or data protection when the device is locked. + * The device is out of space. + * The store could not be migrated to the current model version. + Check the error message to determine what the actual problem was. + */ + NSLog(@"Unresolved error %@, %@", error, error.userInfo); + abort(); + } + }]; + } + } + + return _persistentContainer; +} + +- (NSManagedObjectContext *)managedObjectContext { + // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) + if (_managedObjectContext != nil) { + return _managedObjectContext; + } + + NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; + if (!coordinator) { + return nil; + } + _managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType]; + [_managedObjectContext setPersistentStoreCoordinator:coordinator]; + return _managedObjectContext; +} + +#pragma mark - Core Data Saving support + +- (void)saveContext { + NSManagedObjectContext *context = self.persistentContainer.viewContext; + NSError *error = nil; + if ([context hasChanges] && ![context save:&error]) { + // Replace this implementation with code to handle the error appropriately. + // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + NSLog(@"Unresolved error %@, %@", error, error.userInfo); + abort(); + } +} + +@end diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/Assets.xcassets/AppIcon.appiconset/Contents.json" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/Assets.xcassets/AppIcon.appiconset/Contents.json" new file mode 100644 index 0000000..1d060ed --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/Assets.xcassets/AppIcon.appiconset/Contents.json" @@ -0,0 +1,93 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "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" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/Base.lproj/LaunchScreen.storyboard" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/Base.lproj/LaunchScreen.storyboard" new file mode 100644 index 0000000..fdf3f97 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/Base.lproj/LaunchScreen.storyboard" @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/Base.lproj/Main.storyboard" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/Base.lproj/Main.storyboard" new file mode 100644 index 0000000..1abf241 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/Base.lproj/Main.storyboard" @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/Info.plist" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/Info.plist" new file mode 100644 index 0000000..d052473 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/Info.plist" @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/TaskList.xcdatamodeld/.xccurrentversion" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/TaskList.xcdatamodeld/.xccurrentversion" new file mode 100644 index 0000000..b7ada02 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/TaskList.xcdatamodeld/.xccurrentversion" @@ -0,0 +1,8 @@ + + + + + _XCCurrentVersionName + TaskList.xcdatamodel + + diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/TaskList.xcdatamodeld/TaskList.xcdatamodel/contents" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/TaskList.xcdatamodeld/TaskList.xcdatamodel/contents" new file mode 100644 index 0000000..475bb37 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/TaskList.xcdatamodeld/TaskList.xcdatamodel/contents" @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/ViewController.h" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/ViewController.h" new file mode 100644 index 0000000..4965fd6 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/ViewController.h" @@ -0,0 +1,15 @@ +// +// ViewController.h +// TaskList +// +// Created by 徐欢欢 on 16/10/26. +// Copyright © 2016年 徐欢欢. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/ViewController.m" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/ViewController.m" new file mode 100644 index 0000000..539f075 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/ViewController.m" @@ -0,0 +1,85 @@ +// +// ViewController.m +// TaskList +// +// Created by 徐欢欢 on 16/10/26. +// Copyright © 2016年 徐欢欢. All rights reserved. +// + +#import "ViewController.h" +#import "AppDelegate.h" +#import + +@interface ViewController () + +@property (weak, nonatomic) IBOutlet UITextField *inputTextField; +@property (weak, nonatomic) IBOutlet UITableView *taskTableView; +@property(strong,nonatomic) NSMutableArray *taskArray; +@property(strong,nonatomic) NSArray *arr; + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + NSManagedObjectContext *context = [(AppDelegate*)[[UIApplication sharedApplication] delegate] managedObjectContext]; + NSFetchRequest *fetchData = [[NSFetchRequest alloc] initWithEntityName:@"Task"]; + self.arr = [context executeFetchRequest:fetchData error:nil]; + self.taskArray = [[NSMutableArray alloc] initWithArray:[self.arr valueForKey:@"taskname"]]; +} + +#pragma mark - UITableViewDataSource + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + return self.taskArray.count; +} + +//将数组内容赋值给tableview的每一行 +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyCell" forIndexPath:indexPath]; + cell.textLabel.text = [self.taskArray objectAtIndex:indexPath.row]; + return cell; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)addTaskButtonClick:(id)sender { + + NSString *inputStr = [[NSMutableString alloc] initWithFormat:@"%@",self.inputTextField.text]; + inputStr = [inputStr stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + + + if ([inputStr isEqual: @""]) { + + UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"忘记填写了亲><" preferredStyle:UIAlertControllerStyleAlert]; + [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:nil]]; + [self presentViewController:alert animated:true completion:nil]; + } else { + + //把数据存储到CoreData中; + [self saveToCoreData:inputStr]; + //文本存储到taskArray数组中; + [self.taskArray insertObject:self.inputTextField.text atIndex:self.taskArray.count]; + [self.taskTableView reloadData]; + self.inputTextField.text = nil; + [self.inputTextField resignFirstResponder]; + } +} + +#pragma mark - 保存数据到CoreData; +- (void) saveToCoreData:(NSString *)taskName{ + + NSManagedObjectContext *context = [(AppDelegate*)[[UIApplication sharedApplication] delegate] managedObjectContext]; + NSManagedObject *row = [NSEntityDescription insertNewObjectForEntityForName:@"Task" inManagedObjectContext:context]; + [row setValue:taskName forKey:@"taskname"]; + [context save:nil]; + NSLog(@"已保存到数据库"); +} + +@end diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/main.m" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/main.m" new file mode 100644 index 0000000..8b5ca1d --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskList/main.m" @@ -0,0 +1,16 @@ +// +// main.m +// TaskList +// +// Created by 徐欢欢 on 16/10/26. +// Copyright © 2016年 徐欢欢. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskListTests/Info.plist" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskListTests/Info.plist" new file mode 100644 index 0000000..6c6c23c --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskListTests/Info.plist" @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskListTests/TaskListTests.m" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskListTests/TaskListTests.m" new file mode 100644 index 0000000..a172b11 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskListTests/TaskListTests.m" @@ -0,0 +1,39 @@ +// +// TaskListTests.m +// TaskListTests +// +// Created by 徐欢欢 on 16/10/26. +// Copyright © 2016年 徐欢欢. All rights reserved. +// + +#import + +@interface TaskListTests : XCTestCase + +@end + +@implementation TaskListTests + +- (void)setUp { + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. +} + +- (void)testPerformanceExample { + // This is an example of a performance test case. + [self measureBlock:^{ + // Put the code you want to measure the time of here. + }]; +} + +@end diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskListUITests/Info.plist" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskListUITests/Info.plist" new file mode 100644 index 0000000..6c6c23c --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskListUITests/Info.plist" @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git "a/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskListUITests/TaskListUITests.m" "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskListUITests/TaskListUITests.m" new file mode 100644 index 0000000..4419ad3 --- /dev/null +++ "b/21651172\345\276\220\346\254\242\346\254\242/project03/TaskList/TaskListUITests/TaskListUITests.m" @@ -0,0 +1,40 @@ +// +// TaskListUITests.m +// TaskListUITests +// +// Created by 徐欢欢 on 16/10/26. +// Copyright © 2016年 徐欢欢. All rights reserved. +// + +#import + +@interface TaskListUITests : XCTestCase + +@end + +@implementation TaskListUITests + +- (void)setUp { + [super setUp]; + + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + self.continueAfterFailure = NO; + // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. + [[[XCUIApplication alloc] init] launch]; + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample { + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. +} + +@end