diff --git "a/21651145\351\231\210\344\273\252/README.md" "b/21651145\351\231\210\344\273\252/project01/README.md" similarity index 100% rename from "21651145\351\231\210\344\273\252/README.md" rename to "21651145\351\231\210\344\273\252/project01/README.md" diff --git "a/21651145\351\231\210\344\273\252/project02/README.md" "b/21651145\351\231\210\344\273\252/project02/README.md" new file mode 100644 index 0000000..44565ff --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/README.md" @@ -0,0 +1,10 @@ +功能:在iPhone(模拟器)上根据日期选择打印出一个月历。当然只有改变年、月才有变化。 + +不好意思,没有将第一个作业生成framework再导入,而是直接将CalMonth.h和CalMonth.m文件添加进来。 + +本次作业的详细代码都在storyboard和ViewController.m中。 + +显示月历用的是UILabel控件,用sizeThatFits和setFrame方法实现自适应调整大小显示内容。 +控件是用代码添加,没直接拖到storyboard上。因为如果那样做,不知道为什么程序进入的时候不会自适应调整大小显示内容。 + +用到DatePick控件,其value changed事件的回调方法是:- (IBAction)onYearOrMonthChanged:(id)sender \ No newline at end of file diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/._.DS_Store" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/._.DS_Store" new file mode 100644 index 0000000..a3d6951 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/._.DS_Store" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal.xcodeproj/project.pbxproj" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal.xcodeproj/project.pbxproj" new file mode 100644 index 0000000..541a94c --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal.xcodeproj/project.pbxproj" @@ -0,0 +1,495 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 73B7B6871DB23A1F0053AB49 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73B7B6861DB23A1F0053AB49 /* Foundation.framework */; }; + 73B7B6891DB23A1F0053AB49 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73B7B6881DB23A1F0053AB49 /* CoreGraphics.framework */; }; + 73B7B68B1DB23A1F0053AB49 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73B7B68A1DB23A1F0053AB49 /* UIKit.framework */; }; + 73B7B6911DB23A1F0053AB49 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 73B7B68F1DB23A1F0053AB49 /* InfoPlist.strings */; }; + 73B7B6931DB23A1F0053AB49 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 73B7B6921DB23A1F0053AB49 /* main.m */; }; + 73B7B6971DB23A1F0053AB49 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 73B7B6961DB23A1F0053AB49 /* AppDelegate.m */; }; + 73B7B69A1DB23A1F0053AB49 /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 73B7B6981DB23A1F0053AB49 /* Main_iPhone.storyboard */; }; + 73B7B69D1DB23A1F0053AB49 /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 73B7B69B1DB23A1F0053AB49 /* Main_iPad.storyboard */; }; + 73B7B6A01DB23A1F0053AB49 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 73B7B69F1DB23A1F0053AB49 /* ViewController.m */; }; + 73B7B6A21DB23A1F0053AB49 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 73B7B6A11DB23A1F0053AB49 /* Images.xcassets */; }; + 73B7B6A91DB23A1F0053AB49 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73B7B6A81DB23A1F0053AB49 /* XCTest.framework */; }; + 73B7B6AA1DB23A1F0053AB49 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73B7B6861DB23A1F0053AB49 /* Foundation.framework */; }; + 73B7B6AB1DB23A1F0053AB49 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73B7B68A1DB23A1F0053AB49 /* UIKit.framework */; }; + 73B7B6B31DB23A1F0053AB49 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 73B7B6B11DB23A1F0053AB49 /* InfoPlist.strings */; }; + 73B7B6B51DB23A1F0053AB49 /* iPhoneCalTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 73B7B6B41DB23A1F0053AB49 /* iPhoneCalTests.m */; }; + 73B8109D1DB4B04C005FA19C /* CalMonth.m in Sources */ = {isa = PBXBuildFile; fileRef = 73B8109C1DB4B04C005FA19C /* CalMonth.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 73B7B6AC1DB23A1F0053AB49 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 73B7B67B1DB23A1E0053AB49 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 73B7B6821DB23A1E0053AB49; + remoteInfo = iPhoneCal; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 73B7B6831DB23A1F0053AB49 /* iPhoneCal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iPhoneCal.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 73B7B6861DB23A1F0053AB49 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 73B7B6881DB23A1F0053AB49 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 73B7B68A1DB23A1F0053AB49 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 73B7B68E1DB23A1F0053AB49 /* iPhoneCal-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "iPhoneCal-Info.plist"; sourceTree = ""; }; + 73B7B6901DB23A1F0053AB49 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 73B7B6921DB23A1F0053AB49 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 73B7B6941DB23A1F0053AB49 /* iPhoneCal-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "iPhoneCal-Prefix.pch"; sourceTree = ""; }; + 73B7B6951DB23A1F0053AB49 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 73B7B6961DB23A1F0053AB49 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 73B7B6991DB23A1F0053AB49 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = ""; }; + 73B7B69C1DB23A1F0053AB49 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = ""; }; + 73B7B69E1DB23A1F0053AB49 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 73B7B69F1DB23A1F0053AB49 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 73B7B6A11DB23A1F0053AB49 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 73B7B6A71DB23A1F0053AB49 /* iPhoneCalTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = iPhoneCalTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 73B7B6A81DB23A1F0053AB49 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 73B7B6B01DB23A1F0053AB49 /* iPhoneCalTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "iPhoneCalTests-Info.plist"; sourceTree = ""; }; + 73B7B6B21DB23A1F0053AB49 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 73B7B6B41DB23A1F0053AB49 /* iPhoneCalTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = iPhoneCalTests.m; sourceTree = ""; }; + 73B8109B1DB4B04C005FA19C /* CalMonth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CalMonth.h; sourceTree = ""; }; + 73B8109C1DB4B04C005FA19C /* CalMonth.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CalMonth.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 73B7B6801DB23A1E0053AB49 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 73B7B6891DB23A1F0053AB49 /* CoreGraphics.framework in Frameworks */, + 73B7B68B1DB23A1F0053AB49 /* UIKit.framework in Frameworks */, + 73B7B6871DB23A1F0053AB49 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 73B7B6A41DB23A1F0053AB49 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 73B7B6A91DB23A1F0053AB49 /* XCTest.framework in Frameworks */, + 73B7B6AB1DB23A1F0053AB49 /* UIKit.framework in Frameworks */, + 73B7B6AA1DB23A1F0053AB49 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 73B7B67A1DB23A1E0053AB49 = { + isa = PBXGroup; + children = ( + 73B7B68C1DB23A1F0053AB49 /* iPhoneCal */, + 73B7B6AE1DB23A1F0053AB49 /* iPhoneCalTests */, + 73B7B6851DB23A1F0053AB49 /* Frameworks */, + 73B7B6841DB23A1F0053AB49 /* Products */, + ); + sourceTree = ""; + }; + 73B7B6841DB23A1F0053AB49 /* Products */ = { + isa = PBXGroup; + children = ( + 73B7B6831DB23A1F0053AB49 /* iPhoneCal.app */, + 73B7B6A71DB23A1F0053AB49 /* iPhoneCalTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 73B7B6851DB23A1F0053AB49 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 73B7B6861DB23A1F0053AB49 /* Foundation.framework */, + 73B7B6881DB23A1F0053AB49 /* CoreGraphics.framework */, + 73B7B68A1DB23A1F0053AB49 /* UIKit.framework */, + 73B7B6A81DB23A1F0053AB49 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 73B7B68C1DB23A1F0053AB49 /* iPhoneCal */ = { + isa = PBXGroup; + children = ( + 73B8109B1DB4B04C005FA19C /* CalMonth.h */, + 73B8109C1DB4B04C005FA19C /* CalMonth.m */, + 73B7B6951DB23A1F0053AB49 /* AppDelegate.h */, + 73B7B6961DB23A1F0053AB49 /* AppDelegate.m */, + 73B7B6981DB23A1F0053AB49 /* Main_iPhone.storyboard */, + 73B7B69B1DB23A1F0053AB49 /* Main_iPad.storyboard */, + 73B7B69E1DB23A1F0053AB49 /* ViewController.h */, + 73B7B69F1DB23A1F0053AB49 /* ViewController.m */, + 73B7B6A11DB23A1F0053AB49 /* Images.xcassets */, + 73B7B68D1DB23A1F0053AB49 /* Supporting Files */, + ); + path = iPhoneCal; + sourceTree = ""; + }; + 73B7B68D1DB23A1F0053AB49 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 73B7B68E1DB23A1F0053AB49 /* iPhoneCal-Info.plist */, + 73B7B68F1DB23A1F0053AB49 /* InfoPlist.strings */, + 73B7B6921DB23A1F0053AB49 /* main.m */, + 73B7B6941DB23A1F0053AB49 /* iPhoneCal-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 73B7B6AE1DB23A1F0053AB49 /* iPhoneCalTests */ = { + isa = PBXGroup; + children = ( + 73B7B6B41DB23A1F0053AB49 /* iPhoneCalTests.m */, + 73B7B6AF1DB23A1F0053AB49 /* Supporting Files */, + ); + path = iPhoneCalTests; + sourceTree = ""; + }; + 73B7B6AF1DB23A1F0053AB49 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 73B7B6B01DB23A1F0053AB49 /* iPhoneCalTests-Info.plist */, + 73B7B6B11DB23A1F0053AB49 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 73B7B6821DB23A1E0053AB49 /* iPhoneCal */ = { + isa = PBXNativeTarget; + buildConfigurationList = 73B7B6B81DB23A1F0053AB49 /* Build configuration list for PBXNativeTarget "iPhoneCal" */; + buildPhases = ( + 73B7B67F1DB23A1E0053AB49 /* Sources */, + 73B7B6801DB23A1E0053AB49 /* Frameworks */, + 73B7B6811DB23A1E0053AB49 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = iPhoneCal; + productName = iPhoneCal; + productReference = 73B7B6831DB23A1F0053AB49 /* iPhoneCal.app */; + productType = "com.apple.product-type.application"; + }; + 73B7B6A61DB23A1F0053AB49 /* iPhoneCalTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 73B7B6BB1DB23A1F0053AB49 /* Build configuration list for PBXNativeTarget "iPhoneCalTests" */; + buildPhases = ( + 73B7B6A31DB23A1F0053AB49 /* Sources */, + 73B7B6A41DB23A1F0053AB49 /* Frameworks */, + 73B7B6A51DB23A1F0053AB49 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 73B7B6AD1DB23A1F0053AB49 /* PBXTargetDependency */, + ); + name = iPhoneCalTests; + productName = iPhoneCalTests; + productReference = 73B7B6A71DB23A1F0053AB49 /* iPhoneCalTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 73B7B67B1DB23A1E0053AB49 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0510; + ORGANIZATIONNAME = ChenYi; + TargetAttributes = { + 73B7B6A61DB23A1F0053AB49 = { + TestTargetID = 73B7B6821DB23A1E0053AB49; + }; + }; + }; + buildConfigurationList = 73B7B67E1DB23A1E0053AB49 /* Build configuration list for PBXProject "iPhoneCal" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 73B7B67A1DB23A1E0053AB49; + productRefGroup = 73B7B6841DB23A1F0053AB49 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 73B7B6821DB23A1E0053AB49 /* iPhoneCal */, + 73B7B6A61DB23A1F0053AB49 /* iPhoneCalTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 73B7B6811DB23A1E0053AB49 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 73B7B69D1DB23A1F0053AB49 /* Main_iPad.storyboard in Resources */, + 73B7B6A21DB23A1F0053AB49 /* Images.xcassets in Resources */, + 73B7B69A1DB23A1F0053AB49 /* Main_iPhone.storyboard in Resources */, + 73B7B6911DB23A1F0053AB49 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 73B7B6A51DB23A1F0053AB49 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 73B7B6B31DB23A1F0053AB49 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 73B7B67F1DB23A1E0053AB49 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 73B7B6A01DB23A1F0053AB49 /* ViewController.m in Sources */, + 73B7B6971DB23A1F0053AB49 /* AppDelegate.m in Sources */, + 73B7B6931DB23A1F0053AB49 /* main.m in Sources */, + 73B8109D1DB4B04C005FA19C /* CalMonth.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 73B7B6A31DB23A1F0053AB49 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 73B7B6B51DB23A1F0053AB49 /* iPhoneCalTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 73B7B6AD1DB23A1F0053AB49 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 73B7B6821DB23A1E0053AB49 /* iPhoneCal */; + targetProxy = 73B7B6AC1DB23A1F0053AB49 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 73B7B68F1DB23A1F0053AB49 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 73B7B6901DB23A1F0053AB49 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 73B7B6981DB23A1F0053AB49 /* Main_iPhone.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 73B7B6991DB23A1F0053AB49 /* Base */, + ); + name = Main_iPhone.storyboard; + sourceTree = ""; + }; + 73B7B69B1DB23A1F0053AB49 /* Main_iPad.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 73B7B69C1DB23A1F0053AB49 /* Base */, + ); + name = Main_iPad.storyboard; + sourceTree = ""; + }; + 73B7B6B11DB23A1F0053AB49 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 73B7B6B21DB23A1F0053AB49 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 73B7B6B61DB23A1F0053AB49 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + 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 = 7.1; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 73B7B6B71DB23A1F0053AB49 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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 = 7.1; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 73B7B6B91DB23A1F0053AB49 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "iPhoneCal/iPhoneCal-Prefix.pch"; + INFOPLIST_FILE = "iPhoneCal/iPhoneCal-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 73B7B6BA1DB23A1F0053AB49 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "iPhoneCal/iPhoneCal-Prefix.pch"; + INFOPLIST_FILE = "iPhoneCal/iPhoneCal-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 73B7B6BC1DB23A1F0053AB49 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/iPhoneCal.app/iPhoneCal"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "iPhoneCal/iPhoneCal-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "iPhoneCalTests/iPhoneCalTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 73B7B6BD1DB23A1F0053AB49 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/iPhoneCal.app/iPhoneCal"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "iPhoneCal/iPhoneCal-Prefix.pch"; + INFOPLIST_FILE = "iPhoneCalTests/iPhoneCalTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 73B7B67E1DB23A1E0053AB49 /* Build configuration list for PBXProject "iPhoneCal" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 73B7B6B61DB23A1F0053AB49 /* Debug */, + 73B7B6B71DB23A1F0053AB49 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 73B7B6B81DB23A1F0053AB49 /* Build configuration list for PBXNativeTarget "iPhoneCal" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 73B7B6B91DB23A1F0053AB49 /* Debug */, + 73B7B6BA1DB23A1F0053AB49 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 73B7B6BB1DB23A1F0053AB49 /* Build configuration list for PBXNativeTarget "iPhoneCalTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 73B7B6BC1DB23A1F0053AB49 /* Debug */, + 73B7B6BD1DB23A1F0053AB49 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 73B7B67B1DB23A1E0053AB49 /* Project object */; +} diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._.DS_Store" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._.DS_Store" new file mode 100644 index 0000000..e8a37ce Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._.DS_Store" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._AppDelegate.h" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._AppDelegate.h" new file mode 100644 index 0000000..e297bef Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._AppDelegate.h" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._AppDelegate.m" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._AppDelegate.m" new file mode 100644 index 0000000..b37c886 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._AppDelegate.m" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._CalMonth.h" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._CalMonth.h" new file mode 100644 index 0000000..aee6690 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._CalMonth.h" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._CalMonth.m" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._CalMonth.m" new file mode 100644 index 0000000..544ddd1 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._CalMonth.m" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._ViewController.h" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._ViewController.h" new file mode 100644 index 0000000..1c8abe7 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._ViewController.h" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._ViewController.m" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._ViewController.m" new file mode 100644 index 0000000..fbe2fb9 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._ViewController.m" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._iPhoneCal-Prefix.pch" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._iPhoneCal-Prefix.pch" new file mode 100644 index 0000000..cd858f7 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._iPhoneCal-Prefix.pch" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._main.m" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._main.m" new file mode 100644 index 0000000..8034723 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/._main.m" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/AppDelegate.h" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/AppDelegate.h" new file mode 100644 index 0000000..251fb5f --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/AppDelegate.h" @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// iPhoneCal +// +// Created by iOSChenYi on 16-10-15. +// Copyright (c) 2016骞 ChenYi. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/AppDelegate.m" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/AppDelegate.m" new file mode 100644 index 0000000..ce37e65 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/AppDelegate.m" @@ -0,0 +1,46 @@ +// +// AppDelegate.m +// iPhoneCal +// +// Created by iOSChenYi on 16-10-15. +// Copyright (c) 2016骞 ChenYi. All rights reserved. +// + +#import "AppDelegate.h" + +@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 throttle down OpenGL ES frame rates. 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 inactive 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:. +} + +@end diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/Base.lproj/._.DS_Store" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/Base.lproj/._.DS_Store" new file mode 100644 index 0000000..157d2ff Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/Base.lproj/._.DS_Store" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/Base.lproj/._Main_iPad.storyboard" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/Base.lproj/._Main_iPad.storyboard" new file mode 100644 index 0000000..d3f22c4 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/Base.lproj/._Main_iPad.storyboard" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/Base.lproj/Main_iPad.storyboard" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/Base.lproj/Main_iPad.storyboard" new file mode 100644 index 0000000..4edef30 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/Base.lproj/Main_iPad.storyboard" @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/Base.lproj/Main_iPhone.storyboard" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/Base.lproj/Main_iPhone.storyboard" new file mode 100644 index 0000000..3097629 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/Base.lproj/Main_iPhone.storyboard" @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +VFppZgAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAC5AAAABAAAABCepkign7sVkKCGKqChmveQ +y4kaoNIj9HDSYSYQ1v50INiArZDa/tGg28CQENzes6DdqayQ3r6VoN+JjpDgnneg4WlwkOJ+WaDjSVKQ +5F47oOUpNJDmR1gg5xJREOgnOiDo8jMQ6gccIOrSFRDr5v4g7LH3EO3G4CDukdkQ76/8oPBxuxDxj96g +8n/BkPNvwKD0X6OQ9U+ioPY/hZD3L4Sg+CiiEPkPZqD6CIQQ+viDIPvoZhD82GUg/chIEP64RyD/qCoQ +AJgpIAGIDBACeAsgA3EokARhJ6AFUQqQBkEJoAcw7JAHjUOgCRDOkAmtvyAK8LCQC+CvoAzZzRANwJGg +DrmvEA+priAQmZEQEYmQIBJ5cxATaXIgFFlVEBVJVCAWOTcQFyk2IBgiU5AZCRggGgI1kBryNKAb4heQ +HNIWoB3B+ZAesfigH6HbkCB2KyAhgb2QIlYNICNq2hAkNe8gJUq8ECYV0SAnKp4QJ/7toCkKgBAp3s+g +KupiECu+saAs036QLZ6ToC6zYJAvfnWgMJNCkDFnkiAycySQM0d0IDRTBpA1J1YgNjLokDcHOCA4HAUQ +OOcaIDn75xA6xvwgO9vJEDywGKA9u6sQPo/6oD+bjRBAb9ygQYSpkEJPvqBDZIuQRC+goEVEbZBF89Mg +Ry2KEEfTtSBJDWwQSbOXIErtThBLnLOgTNZqkE18laBOtkyQT1x3oFCWLpBRPFmgUnYQkFMcO6BUVfKQ +VPwdoFY11JBW5TogWB7xEFjFHCBZ/tMQWqT+IFvetRBchOAgXb6XEF5kwiBfnnkQYE3eoGGHlZBiLcCg +Y2d3kGQNoqBlR1mQZe2EoGcnO5BnzWagaQcdkGmtSKBq5v+Qa5ZlIGzQHBBtdkcgbq/+EG9WKSBwj+AQ +cTYLIHJvwhBzFe0gdE+kEHT/CaB2OMCQdt7roHgYopB4vs2gefiEkHqer6B72GaQfH6RoH24SJB+XnOg +f5gqkAABAAECAwEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA +AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA +AQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEA +AQABAAEAAQAB//+dkAEA//+PgAAE//+dkAEI//+dkAEMUERUAFBTVABQV1QAUFBUAAAAAAEAAAABA + + + + + + + + + + + + + + + + + + + + diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/CalMonth.h" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/CalMonth.h" new file mode 100644 index 0000000..ec6e238 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/CalMonth.h" @@ -0,0 +1,29 @@ +// +// CalMonth.h +// CalPrint +// +// Created by iOSChenYi on 16-10-2. +// Copyright (c) 2016骞 ChenYi. All rights reserved. +// + +#import + +@interface CalMonth : NSObject +@property NSUInteger year; +@property NSUInteger month; + +//灏嗚繖涓湀鐨勬瘡涓琛岃緭鍑烘斁鍒發ines涓紝鎻愰珮澶嶇敤鏁堢巼锛屽苟涓斾緵CalYear蹇熶娇鐢ㄣ +@property NSMutableArray *lines; +//鏄惁鏈夛紞j杩欎釜option銆傦紞j鐢ㄦ潵杈撳嚭杩欎釜鏈堟瘡涓澶╂槸杩欎竴骞寸殑绗嚑澶┿ +@property bool jFlag; + +- (NSUInteger) numOfDay; +- (NSUInteger) weekDayOfFirstDay; +- (NSUInteger) indexOfFirstDay; +- (id) init; +- (id) initWithMonth:(NSUInteger)month withJFlag:(bool)flag; +- (id) initWithYear:(NSUInteger)year andMonth:(NSUInteger) month; +- (NSString *) toString; +- (NSDate *) date; +- (void) setLines; +@end diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/CalMonth.m" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/CalMonth.m" new file mode 100644 index 0000000..4aa909d --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/CalMonth.m" @@ -0,0 +1,194 @@ +// +// CalMonth.m +// CalPrint +// +// Created by iOSChenYi on 16-10-2. +// Copyright (c) 2016骞 ChenYi. All rights reserved. +// + +#import "CalMonth.h" + +@implementation CalMonth + +//璁$畻涓涓湀鏈夊灏戝ぉ +- (NSUInteger) numOfDay +{ + NSCalendar *cal=[NSCalendar currentCalendar]; + + NSDate *date=[self date]; + + NSRange range=[cal rangeOfUnit:NSCalendarUnitDay inUnit:NSCalendarUnitMonth forDate:date]; + NSUInteger numOfDay=range.length; + + return numOfDay; +} + +//璁$畻姣忎釜鏈堢涓澶╂槸杩欎竴鍛ㄧ殑绗嚑澶┿傛槦鏈熸棩涓虹涓澶╋紝鏄熸湡涓涓虹浜屽ぉ锛屼緷姝ょ被鎺ㄣ +- (NSUInteger) weekDayOfFirstDay +{ + NSCalendar *cal=[NSCalendar currentCalendar]; + + NSDate *firstDay=[self date]; + NSUInteger weekday=[cal ordinalityOfUnit:NSDayCalendarUnit inUnit:NSWeekCalendarUnit forDate:firstDay]; + + return weekday; +} + +//璁$畻姣忎釜鏈堢涓澶╂槸涓骞翠腑鐨勭鍑犲ぉ +- (NSUInteger) indexOfFirstDay +{ + NSCalendar *cal=[NSCalendar currentCalendar]; + + NSDate *firstDay=[self date]; + NSUInteger index=[cal ordinalityOfUnit:NSDayCalendarUnit inUnit:NSYearCalendarUnit forDate:firstDay]; + + return index; +} + +- (id)init +{ + self=[super init]; + if(self) + { + NSDate *today=[NSDate date]; + NSCalendar *cal=[NSCalendar currentCalendar]; + + //寰楀埌浠婂ぉ鏄摢涓骞村摢涓鏈堛 + NSDateComponents *comps=[cal components:NSCalendarUnitYear|NSCalendarUnitMonth fromDate:today]; + + [self setYear:[comps year]]; + [self setMonth:[comps month]]; + + [self setLines]; + } + return self; +} + +- (id) initWithMonth:(NSUInteger) month withJFlag:(bool)flag +{ + self=[super init]; + if(self) + { + NSDate *today=[NSDate date]; + NSCalendar *cal=[NSCalendar currentCalendar]; + + NSDateComponents *comps=[cal components:NSCalendarUnitYear fromDate:today]; + + [self setYear:[comps year]]; + [self setMonth:month]; + [self setJFlag:flag]; + + [self setLines]; + } + return self; +} + +- (id) initWithYear:(NSUInteger)year andMonth:(NSUInteger)month +{ + self=[super init]; + if(self) + { + [self setYear:year]; + [self setMonth:month]; + + [self setLines]; + } + return self; +} + +//鏍煎紡鍖栬緭鍑鸿繖涓湀 +- (NSString *) toString +{ + NSMutableString *output=[NSMutableString stringWithFormat:@""]; + + NSArray *months=@[@"涓", @"浜", @"涓", + @"鍥", @"浜", @"鍏", + @"涓", @"鍏", @"涔", + @"鍗", @"鍗佷竴", @"鍗佷簩"]; + + //璁剧疆绗竴琛屾渶鍓嶉潰鐨勭┖鐧 + if ([self month]<=10) { + [output appendFormat:@" "]; + } else { + [output appendFormat:@" "]; + } + [output appendFormat:@"%@鏈 %d", [months objectAtIndex:[self month]-1], [self year]]; + + [output appendFormat:@"\n鏃 涓 浜 涓 鍥 浜 鍏璡n"]; + + for(NSString *line in [self lines]) + { + [output appendString:line]; + } + //涓涓湀鍙兘杈撳嚭鍙湁浜旇鏁板瓧锛屾寜鐓х郴缁焎al鐨勪範鎯紝蹇呴』鏈夊叚琛屻 + if ([[self lines] count]<6) { + [output appendString:@"\n"]; + } + return output; +} + +- (void) setLines +{ + //鍒濆鍖杔ines + _lines=[[NSMutableArray alloc] init]; + NSMutableString *output=[NSMutableString stringWithFormat:@""]; + + unsigned long weekday=[self weekDayOfFirstDay]; + unsigned long index=[self indexOfFirstDay]; + unsigned long numOfDay=[self numOfDay]; + + //鍒濆鍖栫涓琛屾渶鍓嶉潰鐨勭┖鐧姐 + for(int i=0; i + +@interface ViewController : UIViewController + +@end diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/ViewController.m" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/ViewController.m" new file mode 100644 index 0000000..8f2a2b5 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/ViewController.m" @@ -0,0 +1,60 @@ +// +// ViewController.m +// iPhoneCal +// +// Created by iOSChenYi on 16-10-15. +// Copyright (c) 2016骞 ChenYi. All rights reserved. +// + +#import "ViewController.h" +#import "CalMonth.h" + +@interface ViewController () + +@end + +@implementation ViewController +{ + UILabel* label; +} +- (IBAction)onYearOrMonthChanged:(id)sender { + NSDate *date=[sender date]; + NSCalendar *cal=[NSCalendar currentCalendar]; + NSDateComponents *comps=[cal components:NSCalendarUnitYear|NSCalendarUnitMonth fromDate:date]; + + CalMonth *month=[[CalMonth alloc] initWithYear:[comps year] andMonth:[comps month]]; + + [self outputToLabel:month]; +} + +- (void)outputToLabel:(CalMonth*)month +{ + [label setNumberOfLines:0]; + [label setText:[month toString]]; + + CGRect screen=[[UIScreen mainScreen] bounds]; + + CGSize expectSize=[label sizeThatFits:CGSizeMake(screen.size.width, screen.size.height)]; + + [label setFrame:CGRectMake((screen.size.width-expectSize.width)/2, 15, expectSize.width, expectSize.height)]; + + [[self view] addSubview:label]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + label=[[UILabel alloc] init]; + + CalMonth *month=[[CalMonth alloc] init]; + [self outputToLabel:month]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/en.lproj/._.DS_Store" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/en.lproj/._.DS_Store" new file mode 100644 index 0000000..87c63d4 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/en.lproj/._.DS_Store" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/en.lproj/._InfoPlist.strings" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/en.lproj/._InfoPlist.strings" new file mode 100644 index 0000000..6f747d6 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/en.lproj/._InfoPlist.strings" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/en.lproj/InfoPlist.strings" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/en.lproj/InfoPlist.strings" new file mode 100644 index 0000000..477b28f --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/en.lproj/InfoPlist.strings" @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/iPhoneCal-Info.plist" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/iPhoneCal-Info.plist" new file mode 100644 index 0000000..4dd524e --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/iPhoneCal-Info.plist" @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.ChenYi.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main_iPhone + UIMainStoryboardFile~ipad + Main_iPad + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/iPhoneCal-Prefix.pch" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/iPhoneCal-Prefix.pch" new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/iPhoneCal-Prefix.pch" @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/main.m" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/main.m" new file mode 100644 index 0000000..3c9496f --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCal/main.m" @@ -0,0 +1,18 @@ +// +// main.m +// iPhoneCal +// +// Created by iOSChenYi on 16-10-15. +// Copyright (c) 2016骞 ChenYi. 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/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCalTests/._iPhoneCalTests.m" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCalTests/._iPhoneCalTests.m" new file mode 100644 index 0000000..4eefce2 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCalTests/._iPhoneCalTests.m" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCalTests/en.lproj/._InfoPlist.strings" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCalTests/en.lproj/._InfoPlist.strings" new file mode 100644 index 0000000..88258aa Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCalTests/en.lproj/._InfoPlist.strings" differ diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCalTests/en.lproj/InfoPlist.strings" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCalTests/en.lproj/InfoPlist.strings" new file mode 100644 index 0000000..477b28f --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCalTests/en.lproj/InfoPlist.strings" @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCalTests/iPhoneCalTests-Info.plist" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCalTests/iPhoneCalTests-Info.plist" new file mode 100644 index 0000000..fd77c6b --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCalTests/iPhoneCalTests-Info.plist" @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.ChenYi.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git "a/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCalTests/iPhoneCalTests.m" "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCalTests/iPhoneCalTests.m" new file mode 100644 index 0000000..90f8c3e --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project02/iPhoneCal/iPhoneCalTests/iPhoneCalTests.m" @@ -0,0 +1,34 @@ +// +// iPhoneCalTests.m +// iPhoneCalTests +// +// Created by iOSChenYi on 16-10-15. +// Copyright (c) 2016骞 ChenYi. All rights reserved. +// + +#import + +@interface iPhoneCalTests : XCTestCase + +@end + +@implementation iPhoneCalTests + +- (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 +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git "a/21651145\351\231\210\344\273\252/project03/README.md" "b/21651145\351\231\210\344\273\252/project03/README.md" new file mode 100644 index 0000000..3ea9322 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/README.md" @@ -0,0 +1,26 @@ +功能:任务管理列表。可以添加、删除、显示完整内容、移动列表行、保存列表。 + +因为是在上课之前就独立完成的,所以主要用到了storyboard、ViewController.m和AppDelegate.m文件。 + +输入内容用到了UITextView控件,不是UITextField,所以输入区域会大一点。 +其边框是在代码中自己瞎写的。请不要嫌丑。 +不知道为什么UITextView控件默认无边框,而且在storyboard中没有这个选项。哭…… + +添加的时候点击Add,可以隐藏软键盘。事件触发的方法为:- (IBAction)addTask:(UIButton *)sender。 +新添加的任务显示在列表最上方。并且无论列表当前滚动到哪里,都会滚动回第一条来进行显示。 + +可以通过左滑列表行来进行删除操作。 + +因为一行可能显示不全任务内容,所以可以通过单击列表行来弹出一个简单的UIAlertView控件来显示完整内容。 + +Edit按键是仿照iPhone通讯录的设计,点击后会进入列表行编辑模式。 +在此模式下,无法进行左滑删除操作和单击行事件,必须点击左边的红圆圈来删除。 +还可以进行移动列表行的操作。 +最后点击Done按键退出此模式。 +在这里吐槽一下,并不理解为什么要有这么严格的行编辑模式。 + +有数据持久化功能。用的是读写Documentation下的Tasks.plist文件。 +是在viewDidLoad方法中加载数据。 +在applicationDidEnterBackground和applicationWillTerminate方法中获得rootViewController来保存列表。 + +最后,点击空白处可以隐藏软键盘,只要你找得到……额,在列表上的空白处是没有用的,因为我没写。 \ No newline at end of file diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/._.DS_Store" "b/21651145\351\231\210\344\273\252/project03/TaskList/._.DS_Store" new file mode 100644 index 0000000..c41fcf2 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/._.DS_Store" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList.xcodeproj/project.pbxproj" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList.xcodeproj/project.pbxproj" new file mode 100644 index 0000000..908d1e0 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList.xcodeproj/project.pbxproj" @@ -0,0 +1,471 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 73BCD5A61DB6148700A3B391 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73BCD5A51DB6148700A3B391 /* Foundation.framework */; }; + 73BCD5A81DB6148700A3B391 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73BCD5A71DB6148700A3B391 /* CoreGraphics.framework */; }; + 73BCD5AA1DB6148700A3B391 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73BCD5A91DB6148700A3B391 /* UIKit.framework */; }; + 73BCD5B01DB6148700A3B391 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 73BCD5AE1DB6148700A3B391 /* InfoPlist.strings */; }; + 73BCD5B21DB6148700A3B391 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 73BCD5B11DB6148700A3B391 /* main.m */; }; + 73BCD5B61DB6148700A3B391 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 73BCD5B51DB6148700A3B391 /* AppDelegate.m */; }; + 73BCD5B91DB6148700A3B391 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 73BCD5B71DB6148700A3B391 /* Main.storyboard */; }; + 73BCD5BC1DB6148700A3B391 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 73BCD5BB1DB6148700A3B391 /* ViewController.m */; }; + 73BCD5BE1DB6148700A3B391 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 73BCD5BD1DB6148700A3B391 /* Images.xcassets */; }; + 73BCD5C51DB6148700A3B391 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73BCD5C41DB6148700A3B391 /* XCTest.framework */; }; + 73BCD5C61DB6148700A3B391 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73BCD5A51DB6148700A3B391 /* Foundation.framework */; }; + 73BCD5C71DB6148700A3B391 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73BCD5A91DB6148700A3B391 /* UIKit.framework */; }; + 73BCD5CF1DB6148700A3B391 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 73BCD5CD1DB6148700A3B391 /* InfoPlist.strings */; }; + 73BCD5D11DB6148700A3B391 /* TaskListTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 73BCD5D01DB6148700A3B391 /* TaskListTests.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 73BCD5C81DB6148700A3B391 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 73BCD59A1DB6148700A3B391 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 73BCD5A11DB6148700A3B391; + remoteInfo = TaskList; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 73BCD5A21DB6148700A3B391 /* TaskList.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TaskList.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 73BCD5A51DB6148700A3B391 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 73BCD5A71DB6148700A3B391 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 73BCD5A91DB6148700A3B391 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 73BCD5AD1DB6148700A3B391 /* TaskList-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TaskList-Info.plist"; sourceTree = ""; }; + 73BCD5AF1DB6148700A3B391 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 73BCD5B11DB6148700A3B391 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 73BCD5B31DB6148700A3B391 /* TaskList-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TaskList-Prefix.pch"; sourceTree = ""; }; + 73BCD5B41DB6148700A3B391 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 73BCD5B51DB6148700A3B391 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 73BCD5B81DB6148700A3B391 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 73BCD5BA1DB6148700A3B391 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 73BCD5BB1DB6148700A3B391 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 73BCD5BD1DB6148700A3B391 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 73BCD5C31DB6148700A3B391 /* TaskListTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TaskListTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 73BCD5C41DB6148700A3B391 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 73BCD5CC1DB6148700A3B391 /* TaskListTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TaskListTests-Info.plist"; sourceTree = ""; }; + 73BCD5CE1DB6148700A3B391 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 73BCD5D01DB6148700A3B391 /* TaskListTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TaskListTests.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 73BCD59F1DB6148700A3B391 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 73BCD5A81DB6148700A3B391 /* CoreGraphics.framework in Frameworks */, + 73BCD5AA1DB6148700A3B391 /* UIKit.framework in Frameworks */, + 73BCD5A61DB6148700A3B391 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 73BCD5C01DB6148700A3B391 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 73BCD5C51DB6148700A3B391 /* XCTest.framework in Frameworks */, + 73BCD5C71DB6148700A3B391 /* UIKit.framework in Frameworks */, + 73BCD5C61DB6148700A3B391 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 73BCD5991DB6148700A3B391 = { + isa = PBXGroup; + children = ( + 73BCD5AB1DB6148700A3B391 /* TaskList */, + 73BCD5CA1DB6148700A3B391 /* TaskListTests */, + 73BCD5A41DB6148700A3B391 /* Frameworks */, + 73BCD5A31DB6148700A3B391 /* Products */, + ); + sourceTree = ""; + }; + 73BCD5A31DB6148700A3B391 /* Products */ = { + isa = PBXGroup; + children = ( + 73BCD5A21DB6148700A3B391 /* TaskList.app */, + 73BCD5C31DB6148700A3B391 /* TaskListTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 73BCD5A41DB6148700A3B391 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 73BCD5A51DB6148700A3B391 /* Foundation.framework */, + 73BCD5A71DB6148700A3B391 /* CoreGraphics.framework */, + 73BCD5A91DB6148700A3B391 /* UIKit.framework */, + 73BCD5C41DB6148700A3B391 /* XCTest.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 73BCD5AB1DB6148700A3B391 /* TaskList */ = { + isa = PBXGroup; + children = ( + 73BCD5B41DB6148700A3B391 /* AppDelegate.h */, + 73BCD5B51DB6148700A3B391 /* AppDelegate.m */, + 73BCD5B71DB6148700A3B391 /* Main.storyboard */, + 73BCD5BA1DB6148700A3B391 /* ViewController.h */, + 73BCD5BB1DB6148700A3B391 /* ViewController.m */, + 73BCD5BD1DB6148700A3B391 /* Images.xcassets */, + 73BCD5AC1DB6148700A3B391 /* Supporting Files */, + ); + path = TaskList; + sourceTree = ""; + }; + 73BCD5AC1DB6148700A3B391 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 73BCD5AD1DB6148700A3B391 /* TaskList-Info.plist */, + 73BCD5AE1DB6148700A3B391 /* InfoPlist.strings */, + 73BCD5B11DB6148700A3B391 /* main.m */, + 73BCD5B31DB6148700A3B391 /* TaskList-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 73BCD5CA1DB6148700A3B391 /* TaskListTests */ = { + isa = PBXGroup; + children = ( + 73BCD5D01DB6148700A3B391 /* TaskListTests.m */, + 73BCD5CB1DB6148700A3B391 /* Supporting Files */, + ); + path = TaskListTests; + sourceTree = ""; + }; + 73BCD5CB1DB6148700A3B391 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 73BCD5CC1DB6148700A3B391 /* TaskListTests-Info.plist */, + 73BCD5CD1DB6148700A3B391 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 73BCD5A11DB6148700A3B391 /* TaskList */ = { + isa = PBXNativeTarget; + buildConfigurationList = 73BCD5D41DB6148700A3B391 /* Build configuration list for PBXNativeTarget "TaskList" */; + buildPhases = ( + 73BCD59E1DB6148700A3B391 /* Sources */, + 73BCD59F1DB6148700A3B391 /* Frameworks */, + 73BCD5A01DB6148700A3B391 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TaskList; + productName = TaskList; + productReference = 73BCD5A21DB6148700A3B391 /* TaskList.app */; + productType = "com.apple.product-type.application"; + }; + 73BCD5C21DB6148700A3B391 /* TaskListTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 73BCD5D71DB6148700A3B391 /* Build configuration list for PBXNativeTarget "TaskListTests" */; + buildPhases = ( + 73BCD5BF1DB6148700A3B391 /* Sources */, + 73BCD5C01DB6148700A3B391 /* Frameworks */, + 73BCD5C11DB6148700A3B391 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 73BCD5C91DB6148700A3B391 /* PBXTargetDependency */, + ); + name = TaskListTests; + productName = TaskListTests; + productReference = 73BCD5C31DB6148700A3B391 /* TaskListTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 73BCD59A1DB6148700A3B391 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0510; + ORGANIZATIONNAME = ChenYi; + TargetAttributes = { + 73BCD5C21DB6148700A3B391 = { + TestTargetID = 73BCD5A11DB6148700A3B391; + }; + }; + }; + buildConfigurationList = 73BCD59D1DB6148700A3B391 /* Build configuration list for PBXProject "TaskList" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 73BCD5991DB6148700A3B391; + productRefGroup = 73BCD5A31DB6148700A3B391 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 73BCD5A11DB6148700A3B391 /* TaskList */, + 73BCD5C21DB6148700A3B391 /* TaskListTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 73BCD5A01DB6148700A3B391 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 73BCD5BE1DB6148700A3B391 /* Images.xcassets in Resources */, + 73BCD5B01DB6148700A3B391 /* InfoPlist.strings in Resources */, + 73BCD5B91DB6148700A3B391 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 73BCD5C11DB6148700A3B391 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 73BCD5CF1DB6148700A3B391 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 73BCD59E1DB6148700A3B391 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 73BCD5BC1DB6148700A3B391 /* ViewController.m in Sources */, + 73BCD5B61DB6148700A3B391 /* AppDelegate.m in Sources */, + 73BCD5B21DB6148700A3B391 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 73BCD5BF1DB6148700A3B391 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 73BCD5D11DB6148700A3B391 /* TaskListTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 73BCD5C91DB6148700A3B391 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 73BCD5A11DB6148700A3B391 /* TaskList */; + targetProxy = 73BCD5C81DB6148700A3B391 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 73BCD5AE1DB6148700A3B391 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 73BCD5AF1DB6148700A3B391 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 73BCD5B71DB6148700A3B391 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 73BCD5B81DB6148700A3B391 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 73BCD5CD1DB6148700A3B391 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 73BCD5CE1DB6148700A3B391 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 73BCD5D21DB6148700A3B391 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + 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 = 7.1; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 73BCD5D31DB6148700A3B391 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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 = 7.1; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 73BCD5D51DB6148700A3B391 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "TaskList/TaskList-Prefix.pch"; + INFOPLIST_FILE = "TaskList/TaskList-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 73BCD5D61DB6148700A3B391 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "TaskList/TaskList-Prefix.pch"; + INFOPLIST_FILE = "TaskList/TaskList-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 73BCD5D81DB6148700A3B391 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/TaskList.app/TaskList"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "TaskList/TaskList-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "TaskListTests/TaskListTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 73BCD5D91DB6148700A3B391 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/TaskList.app/TaskList"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "TaskList/TaskList-Prefix.pch"; + INFOPLIST_FILE = "TaskListTests/TaskListTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 73BCD59D1DB6148700A3B391 /* Build configuration list for PBXProject "TaskList" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 73BCD5D21DB6148700A3B391 /* Debug */, + 73BCD5D31DB6148700A3B391 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 73BCD5D41DB6148700A3B391 /* Build configuration list for PBXNativeTarget "TaskList" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 73BCD5D51DB6148700A3B391 /* Debug */, + 73BCD5D61DB6148700A3B391 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 73BCD5D71DB6148700A3B391 /* Build configuration list for PBXNativeTarget "TaskListTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 73BCD5D81DB6148700A3B391 /* Debug */, + 73BCD5D91DB6148700A3B391 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 73BCD59A1DB6148700A3B391 /* Project object */; +} diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._.DS_Store" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._.DS_Store" new file mode 100644 index 0000000..b010c69 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._.DS_Store" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._AppDelegate.h" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._AppDelegate.h" new file mode 100644 index 0000000..8f5ee3d Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._AppDelegate.h" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._AppDelegate.m" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._AppDelegate.m" new file mode 100644 index 0000000..848b631 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._AppDelegate.m" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._TaskList-Prefix.pch" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._TaskList-Prefix.pch" new file mode 100644 index 0000000..35f74f7 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._TaskList-Prefix.pch" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._ViewController.h" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._ViewController.h" new file mode 100644 index 0000000..78c9f4b Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._ViewController.h" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._ViewController.m" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._ViewController.m" new file mode 100644 index 0000000..899fa7c Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._ViewController.m" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._main.m" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._main.m" new file mode 100644 index 0000000..291dd4f Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/._main.m" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/AppDelegate.h" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/AppDelegate.h" new file mode 100644 index 0000000..ad19584 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/AppDelegate.h" @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// TaskList +// +// Created by iOSChenYi on 16-10-18. +// Copyright (c) 2016骞 ChenYi. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/AppDelegate.m" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/AppDelegate.m" new file mode 100644 index 0000000..728fbcb --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/AppDelegate.m" @@ -0,0 +1,55 @@ +// +// AppDelegate.m +// TaskList +// +// Created by iOSChenYi on 16-10-18. +// Copyright (c) 2016骞 ChenYi. All rights reserved. +// + +#import "AppDelegate.h" +#import "ViewController.h" + +@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 throttle down OpenGL ES frame rates. 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. + UIViewController* v=self.window.rootViewController; + if ([v isKindOfClass:[ViewController class]]) { + [(ViewController*)v saveTaskList]; + } +} + +- (void)applicationWillEnterForeground:(UIApplication *)application +{ + // Called as part of the transition from the background to the inactive 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:. + UIViewController* v=self.window.rootViewController; + if ([v isKindOfClass:[ViewController class]]) { + [(ViewController*)v saveTaskList]; + } +} + +@end diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Base.lproj/._.DS_Store" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Base.lproj/._.DS_Store" new file mode 100644 index 0000000..35038ba Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Base.lproj/._.DS_Store" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Base.lproj/Main.storyboard" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Base.lproj/Main.storyboard" new file mode 100644 index 0000000..cc50dc5 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Base.lproj/Main.storyboard" @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Images.xcassets/._.DS_Store" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Images.xcassets/._.DS_Store" new file mode 100644 index 0000000..f09aaa9 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Images.xcassets/._.DS_Store" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Images.xcassets/AppIcon.appiconset/._Contents.json" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Images.xcassets/AppIcon.appiconset/._Contents.json" new file mode 100644 index 0000000..0e50879 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Images.xcassets/AppIcon.appiconset/._Contents.json" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Images.xcassets/AppIcon.appiconset/Contents.json" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Images.xcassets/AppIcon.appiconset/Contents.json" new file mode 100644 index 0000000..a396706 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Images.xcassets/AppIcon.appiconset/Contents.json" @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Images.xcassets/LaunchImage.launchimage/._Contents.json" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Images.xcassets/LaunchImage.launchimage/._Contents.json" new file mode 100644 index 0000000..c43c056 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Images.xcassets/LaunchImage.launchimage/._Contents.json" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Images.xcassets/LaunchImage.launchimage/Contents.json" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Images.xcassets/LaunchImage.launchimage/Contents.json" new file mode 100644 index 0000000..c79ebd3 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/Images.xcassets/LaunchImage.launchimage/Contents.json" @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/TaskList-Info.plist" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/TaskList-Info.plist" new file mode 100644 index 0000000..a527e27 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/TaskList-Info.plist" @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.ChenYi.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/TaskList-Prefix.pch" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/TaskList-Prefix.pch" new file mode 100644 index 0000000..82a2bb4 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/TaskList-Prefix.pch" @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/ViewController.h" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/ViewController.h" new file mode 100644 index 0000000..32132e9 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/ViewController.h" @@ -0,0 +1,14 @@ +// +// ViewController.h +// TaskList +// +// Created by iOSChenYi on 16-10-18. +// Copyright (c) 2016骞 ChenYi. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + +-(void)saveTaskList; +@end diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/ViewController.m" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/ViewController.m" new file mode 100644 index 0000000..322d0bb --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/ViewController.m" @@ -0,0 +1,145 @@ +// +// ViewController.m +// TaskList +// +// Created by iOSChenYi on 16-10-18. +// Copyright (c) 2016骞 ChenYi. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () +@property (weak, nonatomic) IBOutlet UITextView *inputTask; +@property (weak, nonatomic) IBOutlet UITableView *taskList; + + +@end + +@implementation ViewController +{ + NSMutableArray* list; + BOOL isEditing; +} + +- (IBAction)addTask:(UIButton *)sender { + NSString *task=[NSString stringWithString:[_inputTask text]]; + if (![task isEqual:@""]) + { + [_inputTask setText:@""]; + [_inputTask resignFirstResponder]; + + [list insertObject:task atIndex:0]; + + NSIndexPath *index=[NSIndexPath indexPathForRow:0 inSection:0]; + + [_taskList reloadData]; + [_taskList scrollToRowAtIndexPath:index atScrollPosition:UITableViewScrollPositionTop animated:true]; + } +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"Sample"]; + + if(cell==nil) + { + cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Sample"]; + } + NSUInteger row=[indexPath row]; + cell.textLabel.text=[list objectAtIndex:row]; + + return cell; +} + +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + NSString *task=[list objectAtIndex:[indexPath row]]; + UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Task" message:task delegate:self cancelButtonTitle:@"Return" otherButtonTitles:nil]; + [alert show]; +} + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return 1; +} + +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return [list count]; +} + +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath +{ + [list removeObjectAtIndex:[indexPath row]]; + [_taskList deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; +} + +- (IBAction)setEdit:(UIButton *)sender { + if (isEditing) { + [sender setTitle:@"Edit" forState:UIControlStateNormal]; + [_taskList setEditing:NO animated:NO]; + } else { + [sender setTitle:@"Done" forState:UIControlStateNormal]; + [_taskList setEditing:YES animated:YES]; + } + isEditing=!isEditing; + [_inputTask resignFirstResponder]; +} + +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath +{ + return YES; +} + +- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath +{ + NSString* src=[list objectAtIndex:[sourceIndexPath row]]; + [list removeObjectAtIndex:[sourceIndexPath row]]; + [list insertObject:src atIndex:[destinationIndexPath row]]; + [_taskList reloadData]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + [[_inputTask layer] setBorderWidth:1]; + [[_inputTask layer] setBorderColor:[[UIColor grayColor] CGColor]]; + [[_inputTask layer] setCornerRadius:10]; + + list=[NSMutableArray arrayWithContentsOfFile:[self fileName]]; + if(list==nil) + { + list=[[NSMutableArray alloc] init]; + } + + [_taskList setDelegate:self]; + [_taskList setDataSource:self]; + + isEditing=false; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + [_inputTask resignFirstResponder]; +} + +-(void)saveTaskList +{ + [list writeToFile:[self fileName] atomically:YES]; +} + +- (NSString*)fileName +{ + NSString *path=NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory, NSUserDomainMask, YES).firstObject; + NSString *fileName=[path stringByAppendingString:@"Tasks.plist"]; + + return fileName; +} +@end diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/en.lproj/._.DS_Store" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/en.lproj/._.DS_Store" new file mode 100644 index 0000000..51ce699 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/en.lproj/._.DS_Store" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/en.lproj/._InfoPlist.strings" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/en.lproj/._InfoPlist.strings" new file mode 100644 index 0000000..a04ffb7 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/en.lproj/._InfoPlist.strings" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/en.lproj/InfoPlist.strings" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/en.lproj/InfoPlist.strings" new file mode 100644 index 0000000..477b28f --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/en.lproj/InfoPlist.strings" @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/main.m" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/main.m" new file mode 100644 index 0000000..0e3e07f --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskList/main.m" @@ -0,0 +1,18 @@ +// +// main.m +// TaskList +// +// Created by iOSChenYi on 16-10-18. +// Copyright (c) 2016骞 ChenYi. 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/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/._.DS_Store" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/._.DS_Store" new file mode 100644 index 0000000..989227d Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/._.DS_Store" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/._TaskListTests.m" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/._TaskListTests.m" new file mode 100644 index 0000000..4af2f2a Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/._TaskListTests.m" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/TaskListTests-Info.plist" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/TaskListTests-Info.plist" new file mode 100644 index 0000000..fd77c6b --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/TaskListTests-Info.plist" @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.ChenYi.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/TaskListTests.m" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/TaskListTests.m" new file mode 100644 index 0000000..dc6fbf2 --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/TaskListTests.m" @@ -0,0 +1,34 @@ +// +// TaskListTests.m +// TaskListTests +// +// Created by iOSChenYi on 16-10-18. +// Copyright (c) 2016骞 ChenYi. 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 +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/en.lproj/._.DS_Store" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/en.lproj/._.DS_Store" new file mode 100644 index 0000000..3b111cb Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/en.lproj/._.DS_Store" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/en.lproj/._InfoPlist.strings" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/en.lproj/._InfoPlist.strings" new file mode 100644 index 0000000..cda8815 Binary files /dev/null and "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/en.lproj/._InfoPlist.strings" differ diff --git "a/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/en.lproj/InfoPlist.strings" "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/en.lproj/InfoPlist.strings" new file mode 100644 index 0000000..477b28f --- /dev/null +++ "b/21651145\351\231\210\344\273\252/project03/TaskList/TaskListTests/en.lproj/InfoPlist.strings" @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ +