diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2.xcodeproj/project.pbxproj" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2.xcodeproj/project.pbxproj" new file mode 100644 index 0000000..06771e7 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2.xcodeproj/project.pbxproj" @@ -0,0 +1,323 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 48BE19701DC09BAA00F46C9C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 48BE196F1DC09BAA00F46C9C /* Assets.xcassets */; }; + 48BE19851DC09BE000F46C9C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 48BE197B1DC09BE000F46C9C /* AppDelegate.m */; }; + 48BE19861DC09BE000F46C9C /* CalendarCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 48BE197D1DC09BE000F46C9C /* CalendarCell.m */; }; + 48BE19871DC09BE000F46C9C /* CalendarPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 48BE197F1DC09BE000F46C9C /* CalendarPicker.m */; }; + 48BE19881DC09BE000F46C9C /* CalendarPicker.xib in Resources */ = {isa = PBXBuildFile; fileRef = 48BE19801DC09BE000F46C9C /* CalendarPicker.xib */; }; + 48BE19891DC09BE000F46C9C /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 48BE19811DC09BE000F46C9C /* Info.plist */; }; + 48BE198A1DC09BE000F46C9C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 48BE19821DC09BE000F46C9C /* main.m */; }; + 48BE198B1DC09BE000F46C9C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 48BE19841DC09BE000F46C9C /* ViewController.m */; }; + 48BE198E1DC09BF400F46C9C /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 48BE198C1DC09BF400F46C9C /* LaunchScreen.xib */; }; + 48BE198F1DC09BF400F46C9C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 48BE198D1DC09BF400F46C9C /* Main.storyboard */; }; + 48BE19921DC09D6B00F46C9C /* calendar.m in Sources */ = {isa = PBXBuildFile; fileRef = 48BE19911DC09D6B00F46C9C /* calendar.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 48BE19601DC09BAA00F46C9C /* calender2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = calender2.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 48BE196F1DC09BAA00F46C9C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 48BE197A1DC09BE000F46C9C /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 48BE197B1DC09BE000F46C9C /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 48BE197C1DC09BE000F46C9C /* CalendarCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CalendarCell.h; sourceTree = ""; }; + 48BE197D1DC09BE000F46C9C /* CalendarCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CalendarCell.m; sourceTree = ""; }; + 48BE197E1DC09BE000F46C9C /* CalendarPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CalendarPicker.h; sourceTree = ""; }; + 48BE197F1DC09BE000F46C9C /* CalendarPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CalendarPicker.m; sourceTree = ""; }; + 48BE19801DC09BE000F46C9C /* CalendarPicker.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CalendarPicker.xib; sourceTree = ""; }; + 48BE19811DC09BE000F46C9C /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 48BE19821DC09BE000F46C9C /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 48BE19831DC09BE000F46C9C /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 48BE19841DC09BE000F46C9C /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 48BE198C1DC09BF400F46C9C /* LaunchScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LaunchScreen.xib; sourceTree = ""; }; + 48BE198D1DC09BF400F46C9C /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; + 48BE19901DC09D6B00F46C9C /* calendar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = calendar.h; sourceTree = ""; }; + 48BE19911DC09D6B00F46C9C /* calendar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = calendar.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 48BE195D1DC09BAA00F46C9C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 48BE19571DC09BAA00F46C9C = { + isa = PBXGroup; + children = ( + 48BE19621DC09BAA00F46C9C /* calender2 */, + 48BE19611DC09BAA00F46C9C /* Products */, + ); + sourceTree = ""; + }; + 48BE19611DC09BAA00F46C9C /* Products */ = { + isa = PBXGroup; + children = ( + 48BE19601DC09BAA00F46C9C /* calender2.app */, + ); + name = Products; + sourceTree = ""; + }; + 48BE19621DC09BAA00F46C9C /* calender2 */ = { + isa = PBXGroup; + children = ( + 48BE198C1DC09BF400F46C9C /* LaunchScreen.xib */, + 48BE198D1DC09BF400F46C9C /* Main.storyboard */, + 48BE197A1DC09BE000F46C9C /* AppDelegate.h */, + 48BE197B1DC09BE000F46C9C /* AppDelegate.m */, + 48BE197C1DC09BE000F46C9C /* CalendarCell.h */, + 48BE197D1DC09BE000F46C9C /* CalendarCell.m */, + 48BE197E1DC09BE000F46C9C /* CalendarPicker.h */, + 48BE197F1DC09BE000F46C9C /* CalendarPicker.m */, + 48BE19801DC09BE000F46C9C /* CalendarPicker.xib */, + 48BE19831DC09BE000F46C9C /* ViewController.h */, + 48BE19841DC09BE000F46C9C /* ViewController.m */, + 48BE196F1DC09BAA00F46C9C /* Assets.xcassets */, + 48BE19631DC09BAA00F46C9C /* Supporting Files */, + ); + path = calender2; + sourceTree = ""; + }; + 48BE19631DC09BAA00F46C9C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 48BE19901DC09D6B00F46C9C /* calendar.h */, + 48BE19911DC09D6B00F46C9C /* calendar.m */, + 48BE19811DC09BE000F46C9C /* Info.plist */, + 48BE19821DC09BE000F46C9C /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 48BE195F1DC09BAA00F46C9C /* calender2 */ = { + isa = PBXNativeTarget; + buildConfigurationList = 48BE19771DC09BAA00F46C9C /* Build configuration list for PBXNativeTarget "calender2" */; + buildPhases = ( + 48BE195C1DC09BAA00F46C9C /* Sources */, + 48BE195D1DC09BAA00F46C9C /* Frameworks */, + 48BE195E1DC09BAA00F46C9C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = calender2; + productName = calender2; + productReference = 48BE19601DC09BAA00F46C9C /* calender2.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 48BE19581DC09BAA00F46C9C /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0800; + ORGANIZATIONNAME = Will; + TargetAttributes = { + 48BE195F1DC09BAA00F46C9C = { + CreatedOnToolsVersion = 8.0; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 48BE195B1DC09BAA00F46C9C /* Build configuration list for PBXProject "calender2" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 48BE19571DC09BAA00F46C9C; + productRefGroup = 48BE19611DC09BAA00F46C9C /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 48BE195F1DC09BAA00F46C9C /* calender2 */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 48BE195E1DC09BAA00F46C9C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 48BE198E1DC09BF400F46C9C /* LaunchScreen.xib in Resources */, + 48BE198F1DC09BF400F46C9C /* Main.storyboard in Resources */, + 48BE19701DC09BAA00F46C9C /* Assets.xcassets in Resources */, + 48BE19881DC09BE000F46C9C /* CalendarPicker.xib in Resources */, + 48BE19891DC09BE000F46C9C /* Info.plist in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 48BE195C1DC09BAA00F46C9C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 48BE19871DC09BE000F46C9C /* CalendarPicker.m in Sources */, + 48BE19851DC09BE000F46C9C /* AppDelegate.m in Sources */, + 48BE198A1DC09BE000F46C9C /* main.m in Sources */, + 48BE19921DC09D6B00F46C9C /* calendar.m in Sources */, + 48BE19861DC09BE000F46C9C /* CalendarCell.m in Sources */, + 48BE198B1DC09BE000F46C9C /* ViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 48BE19751DC09BAA00F46C9C /* 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; + }; + 48BE19761DC09BAA00F46C9C /* 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; + }; + 48BE19781DC09BAA00F46C9C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = calender2/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = zju.calender2; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 48BE19791DC09BAA00F46C9C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = calender2/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = zju.calender2; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 48BE195B1DC09BAA00F46C9C /* Build configuration list for PBXProject "calender2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 48BE19751DC09BAA00F46C9C /* Debug */, + 48BE19761DC09BAA00F46C9C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 48BE19771DC09BAA00F46C9C /* Build configuration list for PBXNativeTarget "calender2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 48BE19781DC09BAA00F46C9C /* Debug */, + 48BE19791DC09BAA00F46C9C /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 48BE19581DC09BAA00F46C9C /* Project object */; +} diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2/AppDelegate.h" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/AppDelegate.h" new file mode 100644 index 0000000..53e3154 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/AppDelegate.h" @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// CalendarPicker +// +// Created by 123 on 16/10/26. +// Copyright © 2016年 Will. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2/AppDelegate.m" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/AppDelegate.m" new file mode 100644 index 0000000..42bf141 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/AppDelegate.m" @@ -0,0 +1,45 @@ +// +// AppDelegate.m +// CalendarPicker +// +// Created by 123 on 16/10/26. +// Copyright © 2016年 Will. 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 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/21651004\346\264\252\351\235\231/project02/calender2/calender2/Assets.xcassets/AppIcon.appiconset/Contents.json" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/Assets.xcassets/AppIcon.appiconset/Contents.json" new file mode 100644 index 0000000..36d2c80 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/Assets.xcassets/AppIcon.appiconset/Contents.json" @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "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" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2/CalendarCell.h" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/CalendarCell.h" new file mode 100644 index 0000000..4ac4d74 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/CalendarCell.h" @@ -0,0 +1,13 @@ +// +// CalendarCell.h +// CalendarPicker +// +// Created by 123 on 16/10/26. +// Copyright © 2016年 Will. All rights reserved. +// + +#import + +@interface CalendarCell : UICollectionViewCell +@property (nonatomic , strong) UILabel *dateLabel; +@end diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2/CalendarCell.m" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/CalendarCell.m" new file mode 100644 index 0000000..254d09a --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/CalendarCell.m" @@ -0,0 +1,21 @@ +// +// CalendarCell.m +// CalendarPicker +// +// Created by 123 on 16/10/26. +// Copyright © 2016年 Will. All rights reserved. +// + +#import "CalendarCell.h" + +@implementation CalendarCell +- (UILabel *)dateLabel +{ + if (!_dateLabel) { + _dateLabel = [[UILabel alloc] initWithFrame:self.bounds]; + _dateLabel.font = [UIFont fontWithName:@"Courier" size:20]; + [self addSubview:_dateLabel]; + } + return _dateLabel; +} +@end diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2/CalendarPicker.h" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/CalendarPicker.h" new file mode 100644 index 0000000..864d9c2 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/CalendarPicker.h" @@ -0,0 +1,16 @@ +// +// CalendarPicker.h +// CalendarPicker +// +// Created by 123 on 16/10/26. +// Copyright © 2016年 Will. All rights reserved. +// + +#import + +@interface CalendarPicker : UIView +@property (nonatomic , strong) NSDate *date; +@property (nonatomic , strong) NSDate *today; + ++ (instancetype)showOnView:(UIView *)view; +@end diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2/CalendarPicker.m" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/CalendarPicker.m" new file mode 100644 index 0000000..255351d --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/CalendarPicker.m" @@ -0,0 +1,110 @@ +// +// CalendarPicker.m +// CalendarPicker +// +// Created by 123 on 16/10/26. +// Copyright © 2016年 Will. All rights reserved. +// + +#import "CalendarPicker.h" +#import "CalendarCell.h" +#import "calendar.h" +NSString *const CalendarCellIdentifier = @"cell"; + +@interface CalendarPicker () +@property (nonatomic , weak) IBOutlet UICollectionView *collectionView; +@property (nonatomic , weak) IBOutlet UILabel *monthLabel; +@property (nonatomic , weak) IBOutlet UIButton *previousButton; +@property (nonatomic , weak) IBOutlet UIButton *nextButton; +@property (nonatomic , strong) UIView *mask;//设置底色 +@end + +@implementation CalendarPicker ++ (instancetype)showOnView:(UIView *)view{ + CalendarPicker *calendarPicker = [[[NSBundle mainBundle] loadNibNamed:@"CalendarPicker" owner:self options:nil] firstObject]; + calendarPicker.mask = [[UIView alloc] initWithFrame:view.bounds]; + calendarPicker.mask.backgroundColor = [UIColor blueColor]; + calendarPicker.mask.alpha = 0.2; + [view addSubview:calendarPicker.mask]; + [view addSubview:calendarPicker]; + return calendarPicker; +} + +- (void)awakeFromNib{ + [super awakeFromNib]; + [_collectionView registerClass:[CalendarCell class] forCellWithReuseIdentifier:CalendarCellIdentifier]; +} + +- (void)setDate:(NSDate *)date{ + _date = date; + [_monthLabel setText:[NSString stringWithFormat:@"%.2ld-%li",(long)[self month:date],(long)[self year:date]]]; + [_collectionView reloadData]; +} + +#pragma mark - date +- (NSInteger)month:(NSDate *)date{ + NSDateComponents *components = [[NSCalendar currentCalendar] components:(NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay) fromDate:date]; + return [components month]; +} + +- (NSInteger)year:(NSDate *)date{ + NSDateComponents *components = [[NSCalendar currentCalendar] components:(NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay) fromDate:date]; + return [components year]; +} + +- (NSDate *)previousMonth:(NSDate *)date{ + NSDateComponents *dateComponents = [[NSDateComponents alloc] init]; + dateComponents.month = -1; + NSDate *newDate = [[NSCalendar currentCalendar] dateByAddingComponents:dateComponents toDate:date options:0]; + return newDate; +} + +- (NSDate*)nextMonth:(NSDate *)date{ + NSDateComponents *dateComponents = [[NSDateComponents alloc] init]; + dateComponents.month = +1; + NSDate *newDate = [[NSCalendar currentCalendar] dateByAddingComponents:dateComponents toDate:date options:0]; + return newDate; +} + +#pragma mark - +//有几行 +- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView +{ + return 7; +} + +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ + return 1; +} + +- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ + CalendarCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CalendarCellIdentifier forIndexPath:indexPath]; + calendar *aCalender = [[calendar alloc]init]; + NSArray *contentArray = [NSArray array]; + contentArray = [aCalender outputCalendarWithMonth:[self month:_date] year:[self year:_date]]; + if (indexPath.section < contentArray.count) { + cell.dateLabel.text = @" "; + cell.dateLabel.text = [cell.dateLabel.text stringByAppendingString:contentArray[indexPath.section]]; + } else{ + cell.dateLabel.text = nil; + } + return cell; +} + + +#pragma mark - buttonEvents +- (IBAction)previouseAction:(UIButton *)sender{ + [UIView transitionWithView:self duration:0.5 options:UIViewAnimationOptionTransitionCurlDown animations:^(void) { + self.date = [self previousMonth:self.date]; + } completion:nil]; +} + +- (IBAction)nexAction:(UIButton *)sender{ + [UIView transitionWithView:self duration:0.5 options:UIViewAnimationOptionTransitionCurlUp animations:^(void) { + self.date = [self nextMonth:self.date]; + } completion:nil]; +} + + + +@end diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2/CalendarPicker.xib" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/CalendarPicker.xib" new file mode 100644 index 0000000..51b582a --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/CalendarPicker.xib" @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2/Info.plist" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/Info.plist" new file mode 100644 index 0000000..5cb0af6 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/Info.plist" @@ -0,0 +1,40 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + zhixing.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2/LaunchScreen.xib" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/LaunchScreen.xib" new file mode 100644 index 0000000..d92ebc5 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/LaunchScreen.xib" @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2/Main.storyboard" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/Main.storyboard" new file mode 100644 index 0000000..1e85522 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/Main.storyboard" @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2/ViewController.h" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/ViewController.h" new file mode 100644 index 0000000..fe15e4d --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/ViewController.h" @@ -0,0 +1,14 @@ +// +// ViewController.h +// CalendarPicker +// +// Created by 123 on 16/10/26. +// Copyright © 2016年 Will. All rights reserved. +// +#import + +@interface ViewController : UIViewController + + +@end + diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2/ViewController.m" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/ViewController.m" new file mode 100644 index 0000000..3f220d7 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/ViewController.m" @@ -0,0 +1,35 @@ +// +// ViewController.m +// CalendarPicker +// +// Created by 123 on 16/10/26. +// Copyright © 2016年 Will. All rights reserved. +/// + +#import "ViewController.h" +#import "CalendarPicker.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (IBAction)showAction:(id)sender{ + CalendarPicker *calendarPicker = [CalendarPicker showOnView:self.view]; + calendarPicker.today = [NSDate date]; + calendarPicker.date = calendarPicker.today; + calendarPicker.frame = CGRectMake(0, 100, self.view.frame.size.width, 352); +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2/calendar.h" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/calendar.h" new file mode 100644 index 0000000..ff32f27 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/calendar.h" @@ -0,0 +1,9 @@ + +#import + +@interface calendar : NSObject + + +- (NSArray *)outputCalendarWithMonth:(NSInteger)month year:(NSInteger)year;//输出某年某月的日历 + +@end diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2/calendar.m" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/calendar.m" new file mode 100644 index 0000000..76d9c4b --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/calendar.m" @@ -0,0 +1,69 @@ + +#import "calendar.h" + +@implementation calendar +- (NSArray *)outputCalendarWithMonth:(NSInteger)month year:(NSInteger)year{ + NSArray *result = [NSArray array]; + NSArray *monthInChinese = [NSArray arrayWithObjects:@" 零月",@" 一月",@" 二月",@" 三月",@" 四月",@" 五月",@" 六月",@" 七月",@" 八月",@" 九月",@" 十月",@" 十一月",@" 十二月", nil];//每个月对应的中文 + NSString *weekInChinese = @"日 一 二 三 四 五 六";//星期的中文,中文对不齐,改英文了 + NSArray *dayInChinese = [NSArray arrayWithObjects:@" ",@" 1",@" 2",@" 3",@" 4",@" 5",@" 6",@" 7",@" 8",@" 9",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27",@"28",@"29",@"30",@"31", nil];//一个月的每天的日期,第一个元素用不到 + NSArray *numberOfDaysOfMonth = [NSArray arrayWithObjects:@"0",@"31",@"28",@"31", @"30",@"31",@"30",@"31",@"31",@"30",@"31",@"30",@"31",nil];//每个月的天数 + //判断是否为闰年,如果是就把二月天数换成29 + if(year%400==0||(year%4==0&&year%100!=0)) + numberOfDaysOfMonth = [NSArray arrayWithObjects:@"0",@"31",@"29",@"31", @"30",@"31",@"30",@"31",@"31",@"30",@"31",@"30",@"31",nil]; + //要知道这个月的第一天是周几,通过这个月的第一天和1.1差的天数来计算 + NSInteger date = 0;//记录时间差 + for (NSInteger index = 1; index < month; index++) { + NSString *str = [numberOfDaysOfMonth objectAtIndex:index]; + date += str.intValue; + } + NSInteger firstDayInMonth = (((year-1)+ (year-1)/4-(year-1)/100+(year-1)/400+1)+date)%7; + //开始输出 + //NSLog(@"%@ %li",[monthInChinese objectAtIndex:month],year); + //printf("%s %li\n",[[monthInChinese objectAtIndex:month] UTF8String],year); + //NSLog(@"%@",weekInChinese); + //printf("%s\n",[weekInChinese UTF8String]); + result = [result arrayByAddingObject:weekInChinese]; + NSInteger dayOfBeginning = 7 - firstDayInMonth;//第一行的最后一天的日期 + NSString *totalDaysOfMonth = [numberOfDaysOfMonth objectAtIndex:month]; + NSString *aLineOutput = [NSString string]; + NSString *beginningBlank = [NSString string]; + while (firstDayInMonth != 0) { + firstDayInMonth --; + beginningBlank = [beginningBlank stringByAppendingString:@" "];//每次空3格 + + } + aLineOutput = beginningBlank; + //把剩下的第一行补全 + for(NSInteger index = 1; index <= dayOfBeginning; index++){ + aLineOutput = [aLineOutput stringByAppendingString:[dayInChinese objectAtIndex:index]]; + if(index!=dayOfBeginning) + aLineOutput = [aLineOutput stringByAppendingString:@" "]; + } + //NSLog(@"%@",aLineOutput); + //printf("%s\n",[aLineOutput UTF8String]); + result = [result arrayByAddingObject:aLineOutput]; + aLineOutput = [NSString string]; + dayOfBeginning++;//剩下的开始的日期 + NSInteger nextLineFlag = 0; + while (dayOfBeginning <= totalDaysOfMonth.intValue) { + if(nextLineFlag != 7 ){ + aLineOutput = [aLineOutput stringByAppendingString:[dayInChinese objectAtIndex:dayOfBeginning]]; + aLineOutput = [aLineOutput stringByAppendingString:@" "]; + nextLineFlag++; + dayOfBeginning++; + } else{ + //NSLog(@"%@",aLineOutput); + //printf("%s\n",[aLineOutput UTF8String]); + result = [result arrayByAddingObject:aLineOutput]; + aLineOutput = [NSString string]; + nextLineFlag = 0; + } + } + //NSLog(@"%@",aLineOutput); + //printf("%s\n",[aLineOutput UTF8String]); + result = [result arrayByAddingObject:aLineOutput]; + return result; +} + +@end diff --git "a/21651004\346\264\252\351\235\231/project02/calender2/calender2/main.m" "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/main.m" new file mode 100644 index 0000000..9ef7f8e --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project02/calender2/calender2/main.m" @@ -0,0 +1,9 @@ + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git "a/21651004\346\264\252\351\235\231/project03/TaskList/TaskList.xcodeproj/project.pbxproj" "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList.xcodeproj/project.pbxproj" new file mode 100644 index 0000000..8e4960d --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList.xcodeproj/project.pbxproj" @@ -0,0 +1,318 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 48704D551DC0DB8500665618 /* TableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 48704D541DC0DB8500665618 /* TableViewCell.xib */; }; + 9DA47B2C1DC0CF3F00D6606F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA47B2B1DC0CF3F00D6606F /* main.m */; }; + 9DA47B2F1DC0CF3F00D6606F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA47B2E1DC0CF3F00D6606F /* AppDelegate.m */; }; + 9DA47B321DC0CF3F00D6606F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA47B311DC0CF3F00D6606F /* ViewController.m */; }; + 9DA47B351DC0CF3F00D6606F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9DA47B331DC0CF3F00D6606F /* Main.storyboard */; }; + 9DA47B371DC0CF3F00D6606F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9DA47B361DC0CF3F00D6606F /* Assets.xcassets */; }; + 9DA47B3A1DC0CF3F00D6606F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9DA47B381DC0CF3F00D6606F /* LaunchScreen.storyboard */; }; + 9DA47B441DC0CFAF00D6606F /* TableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA47B421DC0CFAF00D6606F /* TableViewCell.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 48704D541DC0DB8500665618 /* TableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TableViewCell.xib; sourceTree = ""; }; + 9DA47B271DC0CF3F00D6606F /* TaskList.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TaskList.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 9DA47B2B1DC0CF3F00D6606F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 9DA47B2D1DC0CF3F00D6606F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 9DA47B2E1DC0CF3F00D6606F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 9DA47B301DC0CF3F00D6606F /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 9DA47B311DC0CF3F00D6606F /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 9DA47B341DC0CF3F00D6606F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 9DA47B361DC0CF3F00D6606F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 9DA47B391DC0CF3F00D6606F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 9DA47B3B1DC0CF3F00D6606F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9DA47B411DC0CFAF00D6606F /* TableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableViewCell.h; sourceTree = ""; }; + 9DA47B421DC0CFAF00D6606F /* TableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableViewCell.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 9DA47B241DC0CF3F00D6606F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9DA47B1E1DC0CF3E00D6606F = { + isa = PBXGroup; + children = ( + 9DA47B291DC0CF3F00D6606F /* TaskList */, + 9DA47B281DC0CF3F00D6606F /* Products */, + ); + sourceTree = ""; + }; + 9DA47B281DC0CF3F00D6606F /* Products */ = { + isa = PBXGroup; + children = ( + 9DA47B271DC0CF3F00D6606F /* TaskList.app */, + ); + name = Products; + sourceTree = ""; + }; + 9DA47B291DC0CF3F00D6606F /* TaskList */ = { + isa = PBXGroup; + children = ( + 9DA47B2D1DC0CF3F00D6606F /* AppDelegate.h */, + 9DA47B2E1DC0CF3F00D6606F /* AppDelegate.m */, + 9DA47B301DC0CF3F00D6606F /* ViewController.h */, + 9DA47B311DC0CF3F00D6606F /* ViewController.m */, + 9DA47B331DC0CF3F00D6606F /* Main.storyboard */, + 9DA47B361DC0CF3F00D6606F /* Assets.xcassets */, + 9DA47B381DC0CF3F00D6606F /* LaunchScreen.storyboard */, + 9DA47B3B1DC0CF3F00D6606F /* Info.plist */, + 9DA47B2A1DC0CF3F00D6606F /* Supporting Files */, + 9DA47B411DC0CFAF00D6606F /* TableViewCell.h */, + 9DA47B421DC0CFAF00D6606F /* TableViewCell.m */, + 48704D541DC0DB8500665618 /* TableViewCell.xib */, + ); + path = TaskList; + sourceTree = ""; + }; + 9DA47B2A1DC0CF3F00D6606F /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 9DA47B2B1DC0CF3F00D6606F /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 9DA47B261DC0CF3F00D6606F /* TaskList */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9DA47B3E1DC0CF3F00D6606F /* Build configuration list for PBXNativeTarget "TaskList" */; + buildPhases = ( + 9DA47B231DC0CF3F00D6606F /* Sources */, + 9DA47B241DC0CF3F00D6606F /* Frameworks */, + 9DA47B251DC0CF3F00D6606F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TaskList; + productName = TaskList; + productReference = 9DA47B271DC0CF3F00D6606F /* TaskList.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 9DA47B1F1DC0CF3E00D6606F /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0700; + ORGANIZATIONNAME = Will; + TargetAttributes = { + 9DA47B261DC0CF3F00D6606F = { + CreatedOnToolsVersion = 7.0.1; + }; + }; + }; + buildConfigurationList = 9DA47B221DC0CF3E00D6606F /* Build configuration list for PBXProject "TaskList" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 9DA47B1E1DC0CF3E00D6606F; + productRefGroup = 9DA47B281DC0CF3F00D6606F /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 9DA47B261DC0CF3F00D6606F /* TaskList */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 9DA47B251DC0CF3F00D6606F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9DA47B3A1DC0CF3F00D6606F /* LaunchScreen.storyboard in Resources */, + 48704D551DC0DB8500665618 /* TableViewCell.xib in Resources */, + 9DA47B371DC0CF3F00D6606F /* Assets.xcassets in Resources */, + 9DA47B351DC0CF3F00D6606F /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 9DA47B231DC0CF3F00D6606F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9DA47B321DC0CF3F00D6606F /* ViewController.m in Sources */, + 9DA47B441DC0CFAF00D6606F /* TableViewCell.m in Sources */, + 9DA47B2F1DC0CF3F00D6606F /* AppDelegate.m in Sources */, + 9DA47B2C1DC0CF3F00D6606F /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 9DA47B331DC0CF3F00D6606F /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 9DA47B341DC0CF3F00D6606F /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 9DA47B381DC0CF3F00D6606F /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 9DA47B391DC0CF3F00D6606F /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 9DA47B3C1DC0CF3F00D6606F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 9DA47B3D1DC0CF3F00D6606F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 9DA47B3F1DC0CF3F00D6606F /* 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.will.TaskList; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 9DA47B401DC0CF3F00D6606F /* 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.will.TaskList; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 9DA47B221DC0CF3E00D6606F /* Build configuration list for PBXProject "TaskList" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9DA47B3C1DC0CF3F00D6606F /* Debug */, + 9DA47B3D1DC0CF3F00D6606F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 9DA47B3E1DC0CF3F00D6606F /* Build configuration list for PBXNativeTarget "TaskList" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9DA47B3F1DC0CF3F00D6606F /* Debug */, + 9DA47B401DC0CF3F00D6606F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 9DA47B1F1DC0CF3E00D6606F /* Project object */; +} diff --git "a/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/AppDelegate.h" "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/AppDelegate.h" new file mode 100644 index 0000000..fba4ee4 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/AppDelegate.h" @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// TaskList +// +// Created by 123 on 16/10/26. +// Copyright © 2016年 Will. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git "a/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/AppDelegate.m" "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/AppDelegate.m" new file mode 100644 index 0000000..06ca8db --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/AppDelegate.m" @@ -0,0 +1,45 @@ +// +// AppDelegate.m +// TaskList +// +// Created by 123 on 16/10/26. +// Copyright © 2016年 Will. 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 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/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/Assets.xcassets/AppIcon.appiconset/Contents.json" "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/Assets.xcassets/AppIcon.appiconset/Contents.json" new file mode 100644 index 0000000..1d060ed --- /dev/null +++ "b/21651004\346\264\252\351\235\231/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/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/Base.lproj/LaunchScreen.storyboard" "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/Base.lproj/LaunchScreen.storyboard" new file mode 100644 index 0000000..2e721e1 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/Base.lproj/LaunchScreen.storyboard" @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/Base.lproj/Main.storyboard" "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/Base.lproj/Main.storyboard" new file mode 100644 index 0000000..06a4944 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/Base.lproj/Main.storyboard" @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/Info.plist" "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/Info.plist" new file mode 100644 index 0000000..40c6215 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/Info.plist" @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git "a/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/TableViewCell.h" "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/TableViewCell.h" new file mode 100644 index 0000000..b0f13df --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/TableViewCell.h" @@ -0,0 +1,24 @@ +// +// TableViewCell.h +// TaskList +// +// Created by 123 on 16/10/26. +// Copyright © 2016年 Will. All rights reserved. +// + +#import + +@protocol TableViewCellDelegate; +@interface TableViewCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UILabel *taskLabel; + +@property (strong, nonatomic) id delegate; + +@end + +@protocol TableViewCellDelegate + +- (void)finishedTaskTableViewCell:(TableViewCell *)cell; + + +@end diff --git "a/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/TableViewCell.m" "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/TableViewCell.m" new file mode 100644 index 0000000..742544e --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/TableViewCell.m" @@ -0,0 +1,29 @@ +// +// TableViewCell.m +// TaskList +// +// Created by 123 on 16/10/26. +// Copyright © 2016年 Will. All rights reserved. +// + +#import "TableViewCell.h" + +@implementation TableViewCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} + +- (IBAction)taskFinished:(id)sender { + //要删除这条记录,刷新tableView,通知delegate 调用方法 + [self.delegate finishedTaskTableViewCell:self]; +} + +//- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + //[super setSelected:selected animated:animated]; + + //Configure the view for the selected state +//} + +@end diff --git "a/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/TableViewCell.xib" "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/TableViewCell.xib" new file mode 100644 index 0000000..d36cbc1 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/TableViewCell.xib" @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/ViewController.h" "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/ViewController.h" new file mode 100644 index 0000000..ae17807 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/ViewController.h" @@ -0,0 +1,15 @@ +// +// ViewController.h +// TaskList +// +// Created by 123 on 16/10/26. +// Copyright © 2016年 Will. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git "a/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/ViewController.m" "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/ViewController.m" new file mode 100644 index 0000000..20f5604 --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/ViewController.m" @@ -0,0 +1,111 @@ +// +// ViewController.m +// TaskList +// +// Created by 123 on 16/10/26. +// Copyright © 2016年 Will. All rights reserved. +// + +#import "ViewController.h" +#import "TableViewCell.h" + +@interface ViewController () +@property (weak, nonatomic) IBOutlet UITextField *taskTextField; +@property (weak, nonatomic) IBOutlet UITableView *taskTableView; + +@property (copy, nonatomic) NSArray *taskArray;//待办任务 +@property (copy, nonatomic) NSString *tasksPlistPath; + +@end + +@implementation ViewController +#pragma mark - lazy +- (NSArray *)taskArray{ + if (_taskArray == nil) { + _taskArray = [NSArray array]; + } + return _taskArray; +} +#pragma mark - buttonEvent +- (IBAction)addTask:(id)sender { + //把任务添加到数组中,并且刷新tableView + //NSArray *array = [NSArray array]; + if (![_taskTextField.text isEqualToString:@""]) { + //可以添加到数组中,但要保证是不同的任务 + if (![_taskArray containsObject:_taskTextField.text]) { + _taskArray = [_taskArray arrayByAddingObject:_taskTextField.text]; + [_taskArray writeToFile:_tasksPlistPath atomically:YES]; + [_taskTableView reloadData]; + } + } +} +#pragma mark - View + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. + self.tasksPlistPath = [ViewController createTasksPlist];//已经创建了任务清单 + NSArray *tasksArray = [[NSArray alloc]initWithContentsOfFile:_tasksPlistPath]; + self.taskArray = tasksArray; + self.taskTableView.dataSource = self; +} + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ + [self.view endEditing:YES]; //实现该方法是需要注意view需要是继承UIControl而来的 +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - +- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index{ + //可以按照日期来分组,这里暂分1组 + return 1; +} +//有几行 +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + NSLog(@"%lu",(unsigned long)self.taskArray.count); + return self.taskArray.count; +} +//每一行的cell +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + //定义标记 + static NSString *cellIdentifier = @"cell"; + //从缓冲池中取出cell + TableViewCell *cell = (TableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier]; + //缓冲池中没有cell + if(cell == nil){ + //从xib文件中加载出来 + cell = [[NSBundle mainBundle] loadNibNamed:@"TableViewCell" owner:nil options:nil][0]; + cell.delegate = self; + } + cell.taskLabel.text = self.taskArray[indexPath.row]; + return cell; +} +#pragma mark - +- (void)finishedTaskTableViewCell:(TableViewCell *)cell{ + //在数组中移除任务 + NSString *finishedTask = cell.taskLabel.text; + NSArray *newTasksArray = [NSArray array]; + for (int index = 0; index < _taskArray.count; index ++) { + if (![_taskArray[index] isEqualToString:finishedTask]) { + newTasksArray = [newTasksArray arrayByAddingObject:_taskArray[index]]; + } + } + _taskArray = newTasksArray; + [_taskTableView reloadData]; +} +#pragma mark - other ++ (NSString *)createTasksPlist{ + //获取caches文件路径 + NSArray *path = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); + //获取完整路径 + NSString *cachesPath = [path objectAtIndex:0]; + NSString *tasksPlistPath = [cachesPath stringByAppendingPathComponent:@"tasks.plist"]; + return tasksPlistPath; +} + + +@end diff --git "a/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/main.m" "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/main.m" new file mode 100644 index 0000000..4c1f4ee --- /dev/null +++ "b/21651004\346\264\252\351\235\231/project03/TaskList/TaskList/main.m" @@ -0,0 +1,16 @@ +// +// main.m +// TaskList +// +// Created by 123 on 16/10/26. +// Copyright © 2016年 Will. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +}