diff --git "a/21600000\346\235\216\345\220\257\351\233\267/project02/MyPaint/MyView.m" "b/21600000\346\235\216\345\220\257\351\233\267/project02/MyPaint/MyView.m" index a367f6f..f1cb30e 100644 --- "a/21600000\346\235\216\345\220\257\351\233\267/project02/MyPaint/MyView.m" +++ "b/21600000\346\235\216\345\220\257\351\233\267/project02/MyPaint/MyView.m" @@ -15,10 +15,16 @@ - (void) drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBFillColor(context, 0.5, 0, 0.5, 0.4); - CGContextFillRect(context, CGRectMake(rect.origin.x+10, - rect.origin.y+10, - rect.size.width-20, - rect.size.width - 20)); +// CGContextFillRect(context, CGRectMake(rect.origin.x+10, +// rect.origin.y+10, +// rect.size.width-20, +// rect.size.width - 20)); + + + + + + } @end diff --git "a/21600000\346\235\216\345\220\257\351\233\267/project02/MyPaint/main.m" "b/21600000\346\235\216\345\220\257\351\233\267/project02/MyPaint/main.m" index ae84688..5256aa1 100644 --- "a/21600000\346\235\216\345\220\257\351\233\267/project02/MyPaint/main.m" +++ "b/21600000\346\235\216\345\220\257\351\233\267/project02/MyPaint/main.m" @@ -13,4 +13,4 @@ int main(int argc, char * argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } -} +} \ No newline at end of file diff --git "a/21651133\351\231\210\345\206\233/README.md" "b/21651133\351\231\210\345\206\233/README.md" index 240c938..36fff44 100644 --- "a/21651133\351\231\210\345\206\233/README.md" +++ "b/21651133\351\231\210\345\206\233/README.md" @@ -1,3 +1,29 @@ +##第二次作业 移植cal到ios平台 + +####基本功能 + 可实现选择月份和年份,不过为了简单考虑,只是用datepicker来作为用户的选择的工具 + +####学习到的知识 +* NSString、NSMutableString的进一步认识 +* Framework的制作与使用 + + +##第三次作业 实现Todo List + +####基本功能 + +* 添加task +* 数据保存到本地,用plist +* 长按某个task,可以删除该task + +####学习到的知识 +* UITableView、UITableViewCell的知识 +* 对视图层次有更进一步的认识 +* 对如何在代码中实现界面有了一定的体会 +* 对ios中的事件机制有了进一步的了解 +* 对Category的认识 + + ##第一次作业 简单实现macOS下的cal ####三种基本的功能 diff --git "a/21651133\351\231\210\345\206\233/project02/CJCal.xcodeproj/project.pbxproj" "b/21651133\351\231\210\345\206\233/project02/CJCal.xcodeproj/project.pbxproj" new file mode 100644 index 0000000..d4a4927 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/CJCal.xcodeproj/project.pbxproj" @@ -0,0 +1,345 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 6A3A71A31DC052F600D6CD92 /* libmycal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A3A71A21DC052F600D6CD92 /* libmycal.framework */; }; + 6A3A71A41DC052F600D6CD92 /* libmycal.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6A3A71A21DC052F600D6CD92 /* libmycal.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 6A3A71A71DC081E500D6CD92 /* CJView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A3A71A61DC081E500D6CD92 /* CJView.m */; }; + 6AD27A791DBF8EED00118A28 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AD27A781DBF8EED00118A28 /* main.m */; }; + 6AD27A7C1DBF8EED00118A28 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AD27A7B1DBF8EED00118A28 /* AppDelegate.m */; }; + 6AD27A7F1DBF8EED00118A28 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AD27A7E1DBF8EED00118A28 /* ViewController.m */; }; + 6AD27A821DBF8EED00118A28 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6AD27A801DBF8EED00118A28 /* Main.storyboard */; }; + 6AD27A841DBF8EED00118A28 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6AD27A831DBF8EED00118A28 /* Assets.xcassets */; }; + 6AD27A871DBF8EED00118A28 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6AD27A851DBF8EED00118A28 /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 6AD27A911DBF96BA00118A28 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 6A3A71A41DC052F600D6CD92 /* libmycal.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 6A3A71A21DC052F600D6CD92 /* libmycal.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = libmycal.framework; sourceTree = ""; }; + 6A3A71A51DC0819700D6CD92 /* CJView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJView.h; sourceTree = ""; }; + 6A3A71A61DC081E500D6CD92 /* CJView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJView.m; sourceTree = ""; }; + 6AD27A741DBF8EED00118A28 /* CJCal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CJCal.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6AD27A781DBF8EED00118A28 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 6AD27A7A1DBF8EED00118A28 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 6AD27A7B1DBF8EED00118A28 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 6AD27A7D1DBF8EED00118A28 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 6AD27A7E1DBF8EED00118A28 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 6AD27A811DBF8EED00118A28 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 6AD27A831DBF8EED00118A28 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 6AD27A861DBF8EED00118A28 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 6AD27A881DBF8EED00118A28 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6AD27A711DBF8EED00118A28 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6A3A71A31DC052F600D6CD92 /* libmycal.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 6AD27A6B1DBF8EED00118A28 = { + isa = PBXGroup; + children = ( + 6A3A71A21DC052F600D6CD92 /* libmycal.framework */, + 6AD27A761DBF8EED00118A28 /* CJCal */, + 6AD27A751DBF8EED00118A28 /* Products */, + ); + sourceTree = ""; + }; + 6AD27A751DBF8EED00118A28 /* Products */ = { + isa = PBXGroup; + children = ( + 6AD27A741DBF8EED00118A28 /* CJCal.app */, + ); + name = Products; + sourceTree = ""; + }; + 6AD27A761DBF8EED00118A28 /* CJCal */ = { + isa = PBXGroup; + children = ( + 6AD27A7A1DBF8EED00118A28 /* AppDelegate.h */, + 6AD27A7B1DBF8EED00118A28 /* AppDelegate.m */, + 6AD27A7D1DBF8EED00118A28 /* ViewController.h */, + 6AD27A7E1DBF8EED00118A28 /* ViewController.m */, + 6AD27A801DBF8EED00118A28 /* Main.storyboard */, + 6AD27A831DBF8EED00118A28 /* Assets.xcassets */, + 6AD27A851DBF8EED00118A28 /* LaunchScreen.storyboard */, + 6AD27A881DBF8EED00118A28 /* Info.plist */, + 6AD27A771DBF8EED00118A28 /* Supporting Files */, + 6A3A71A51DC0819700D6CD92 /* CJView.h */, + 6A3A71A61DC081E500D6CD92 /* CJView.m */, + ); + path = CJCal; + sourceTree = ""; + }; + 6AD27A771DBF8EED00118A28 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 6AD27A781DBF8EED00118A28 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6AD27A731DBF8EED00118A28 /* CJCal */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6AD27A8B1DBF8EED00118A28 /* Build configuration list for PBXNativeTarget "CJCal" */; + buildPhases = ( + 6AD27A701DBF8EED00118A28 /* Sources */, + 6AD27A711DBF8EED00118A28 /* Frameworks */, + 6AD27A721DBF8EED00118A28 /* Resources */, + 6AD27A911DBF96BA00118A28 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CJCal; + productName = CJCal; + productReference = 6AD27A741DBF8EED00118A28 /* CJCal.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6AD27A6C1DBF8EED00118A28 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0730; + ORGANIZATIONNAME = Chanjun2016; + TargetAttributes = { + 6AD27A731DBF8EED00118A28 = { + CreatedOnToolsVersion = 7.3; + DevelopmentTeam = UL9C9N8227; + }; + }; + }; + buildConfigurationList = 6AD27A6F1DBF8EED00118A28 /* Build configuration list for PBXProject "CJCal" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6AD27A6B1DBF8EED00118A28; + productRefGroup = 6AD27A751DBF8EED00118A28 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6AD27A731DBF8EED00118A28 /* CJCal */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6AD27A721DBF8EED00118A28 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6AD27A871DBF8EED00118A28 /* LaunchScreen.storyboard in Resources */, + 6AD27A841DBF8EED00118A28 /* Assets.xcassets in Resources */, + 6AD27A821DBF8EED00118A28 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6AD27A701DBF8EED00118A28 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6AD27A7F1DBF8EED00118A28 /* ViewController.m in Sources */, + 6AD27A7C1DBF8EED00118A28 /* AppDelegate.m in Sources */, + 6AD27A791DBF8EED00118A28 /* main.m in Sources */, + 6A3A71A71DC081E500D6CD92 /* CJView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 6AD27A801DBF8EED00118A28 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6AD27A811DBF8EED00118A28 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 6AD27A851DBF8EED00118A28 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6AD27A861DBF8EED00118A28 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 6AD27A891DBF8EED00118A28 /* 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_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.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 6AD27A8A1DBF8EED00118A28 /* 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_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.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 6AD27A8C1DBF8EED00118A28 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + INFOPLIST_FILE = CJCal/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.chanjun2016.CJCal; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 6AD27A8D1DBF8EED00118A28 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + INFOPLIST_FILE = CJCal/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.chanjun2016.CJCal; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6AD27A6F1DBF8EED00118A28 /* Build configuration list for PBXProject "CJCal" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6AD27A891DBF8EED00118A28 /* Debug */, + 6AD27A8A1DBF8EED00118A28 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6AD27A8B1DBF8EED00118A28 /* Build configuration list for PBXNativeTarget "CJCal" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6AD27A8C1DBF8EED00118A28 /* Debug */, + 6AD27A8D1DBF8EED00118A28 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6AD27A6C1DBF8EED00118A28 /* Project object */; +} diff --git "a/21651133\351\231\210\345\206\233/project02/CJCal/AppDelegate.h" "b/21651133\351\231\210\345\206\233/project02/CJCal/AppDelegate.h" new file mode 100644 index 0000000..6a2b84e --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/CJCal/AppDelegate.h" @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// CJCal +// +// Created by Chanjun2016 on 16/10/25. +// Copyright © 2016年 Chanjun2016. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git "a/21651133\351\231\210\345\206\233/project02/CJCal/AppDelegate.m" "b/21651133\351\231\210\345\206\233/project02/CJCal/AppDelegate.m" new file mode 100644 index 0000000..32440ea --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/CJCal/AppDelegate.m" @@ -0,0 +1,56 @@ +// +// AppDelegate.m +// CJCal +// +// Created by Chanjun2016 on 16/10/25. +// Copyright © 2016年 Chanjun2016. All rights reserved. +// + +#import "AppDelegate.h" +#import "CJView.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + +// self.window = [[UIWindow alloc] init]; +// _window.frame = [[UIScreen mainScreen] bounds]; +// _window.backgroundColor = [UIColor whiteColor]; +// [_window makeKeyAndVisible]; +// +// _window.rootViewController = [[UIViewController alloc] init]; +// NSInteger nMargin = 40; +// [_window.rootViewController.view addSubview: [[CJView alloc] initWithFrame:CGRectMake(nMargin, nMargin, _window.frame.size.width - nMargin, _window.frame.size.width)]]; + + // 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/21651133\351\231\210\345\206\233/project02/CJCal/Assets.xcassets/AppIcon.appiconset/Contents.json" "b/21651133\351\231\210\345\206\233/project02/CJCal/Assets.xcassets/AppIcon.appiconset/Contents.json" new file mode 100644 index 0000000..eeea76c --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/CJCal/Assets.xcassets/AppIcon.appiconset/Contents.json" @@ -0,0 +1,73 @@ +{ + "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" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21651133\351\231\210\345\206\233/project02/CJCal/Base.lproj/LaunchScreen.storyboard" "b/21651133\351\231\210\345\206\233/project02/CJCal/Base.lproj/LaunchScreen.storyboard" new file mode 100644 index 0000000..1fa91aa --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/CJCal/Base.lproj/LaunchScreen.storyboard" @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651133\351\231\210\345\206\233/project02/CJCal/Base.lproj/Main.storyboard" "b/21651133\351\231\210\345\206\233/project02/CJCal/Base.lproj/Main.storyboard" new file mode 100644 index 0000000..4f07d64 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/CJCal/Base.lproj/Main.storyboard" @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651133\351\231\210\345\206\233/project02/CJCal/CJView.h" "b/21651133\351\231\210\345\206\233/project02/CJCal/CJView.h" new file mode 100644 index 0000000..e116c63 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/CJCal/CJView.h" @@ -0,0 +1,13 @@ +// +// CJView.h +// CJCal +// +// Created by Chanjun2016 on 16/10/26. +// Copyright © 2016年 Chanjun2016. All rights reserved. +// + +#import + +@interface CJView : UIView + +@end diff --git "a/21651133\351\231\210\345\206\233/project02/CJCal/CJView.m" "b/21651133\351\231\210\345\206\233/project02/CJCal/CJView.m" new file mode 100644 index 0000000..7197db7 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/CJCal/CJView.m" @@ -0,0 +1,37 @@ +// +// CJView.m +// CJCal +// +// Created by Chanjun2016 on 16/10/26. +// Copyright © 2016年 Chanjun2016. All rights reserved. +// + +#import "CjView.h" +@import libmycal; + +#define ROWS 8 + +@implementation CJView + +- (void) drawRect:(CGRect)rect { + CGContextRef context = UIGraphicsGetCurrentContext(); + + CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0); + CGContextFillRect(context, rect); + + UIFont* font = [UIFont fontWithName:@"Courier" size:20]; + + [[Calendar getInstance] calWithGivenMon:10 Year:2016]; + + NSDictionary* attrs = @{ + NSFontAttributeName:font + }; + CGRect rowRect = CGRectMake(0, 0, rect.size.width, rect.size.height); + + [[Calendar getInstance].buffer drawInRect:rowRect withAttributes:attrs]; + + NSLog(@"%@",[Calendar getInstance].buffer); + +} + +@end \ No newline at end of file diff --git "a/21651133\351\231\210\345\206\233/project02/CJCal/Info.plist" "b/21651133\351\231\210\345\206\233/project02/CJCal/Info.plist" new file mode 100644 index 0000000..40c6215 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/CJCal/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/21651133\351\231\210\345\206\233/project02/CJCal/ViewController.h" "b/21651133\351\231\210\345\206\233/project02/CJCal/ViewController.h" new file mode 100644 index 0000000..ae328c6 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/CJCal/ViewController.h" @@ -0,0 +1,15 @@ +// +// ViewController.h +// CJCal +// +// Created by Chanjun2016 on 16/10/25. +// Copyright © 2016年 Chanjun2016. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git "a/21651133\351\231\210\345\206\233/project02/CJCal/ViewController.m" "b/21651133\351\231\210\345\206\233/project02/CJCal/ViewController.m" new file mode 100644 index 0000000..6befb47 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/CJCal/ViewController.m" @@ -0,0 +1,50 @@ +// +// ViewController.m +// CJCal +// +// Created by Chanjun2016 on 16/10/25. +// Copyright © 2016年 Chanjun2016. All rights reserved. +// + +#import "ViewController.h" +@import libmycal; + +@interface ViewController () +@property (weak, nonatomic) IBOutlet UITextView *viewCal; + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (IBAction)dateChanged:(UIDatePicker *)sender { + + UIDatePicker* dp = (UIDatePicker*)sender; + NSDate* date = [dp date]; + NSCalendar* cal = [NSCalendar currentCalendar]; + NSInteger year = [cal component:NSCalendarUnitYear fromDate:date]; + NSInteger month = [cal component:NSCalendarUnitMonth fromDate:date]; + //NSInteger day = [cal component:NSCalendarUnitDay fromDate:date]; + + [[Calendar getInstance] calWithGivenMon:month Year:year]; + + NSString * content = [NSString stringWithFormat:@"%@",[[Calendar getInstance] buffer]]; + + _viewCal.font = [UIFont fontWithName:@"courier" size:25]; + + [[[Calendar getInstance] buffer] setString:@""]; + + [_viewCal setText:content]; + +} + +@end diff --git "a/21651133\351\231\210\345\206\233/project02/CJCal/main.m" "b/21651133\351\231\210\345\206\233/project02/CJCal/main.m" new file mode 100644 index 0000000..29bbc7e --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/CJCal/main.m" @@ -0,0 +1,16 @@ +// +// main.m +// CJCal +// +// Created by Chanjun2016 on 16/10/25. +// Copyright © 2016年 Chanjun2016. 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/21651133\351\231\210\345\206\233/project02/libmycal.framework/Headers" "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/Headers" new file mode 120000 index 0000000..a177d2a --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/Headers" @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git "a/21651133\351\231\210\345\206\233/project02/libmycal.framework/Info.plist" "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/Info.plist" new file mode 100644 index 0000000..3439bd4 Binary files /dev/null and "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/Info.plist" differ diff --git "a/21651133\351\231\210\345\206\233/project02/libmycal.framework/Modules/module.modulemap" "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/Modules/module.modulemap" new file mode 100644 index 0000000..7b97a1e --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/Modules/module.modulemap" @@ -0,0 +1,6 @@ +framework module libmycal { + umbrella header "libmycal.h" + + export * + module * { export * } +} diff --git "a/21651133\351\231\210\345\206\233/project02/libmycal.framework/Versions/A/Headers/Calendar.h" "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/Versions/A/Headers/Calendar.h" new file mode 100644 index 0000000..49eb0a6 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/Versions/A/Headers/Calendar.h" @@ -0,0 +1,58 @@ +// +// Calendar.h +// cal +// +// Created by Chanjun2016 on 16/10/6. +// Copyright © 2016年 Chanjun2016. All rights reserved. +// + +#import + +#ifdef DEBUG +#define NSLog(FORMAT, ...) fprintf(stderr,"%s\n",[[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]); +#else +#define NSLog(...) +#endif + +typedef enum{ + unKnown, + currentMon, + givenMonYear, + givenYear, +}SpecifiedFuncType; + +@interface Calendar : NSObject + +- (id) init; + ++ (Calendar*) getInstance; + +- (char *) handleInput :(int)argn :(const char* [])argv; + +- (void)calWithCurMon:(int)mon : (int)year :(int)weekFirst; +- (void)calWithGivenMon: (int)mon Year: (int)year; +- (void)calWithGivenYear:(int)year; + +- (void)printMonthHeadLine:(int)mon :(int)year; + +- (void)printYearOfRow:(int)row; + +- (int)printMonRow:(int)row : (int)days : (int)weekFirst; + +- (int)countDaysOfMonth:(int)year : (int)month; + ++ (int)convertIntValue:(const char*)str; + ++ (int)getWeekFirstOfMon:(int)year :(int)mon; + +- (void)display; + +@property int year; +@property int month; +@property int day; +@property int week; +@property NSMutableString* buffer; + +@end + +/* Calendar_h */ \ No newline at end of file diff --git "a/21651133\351\231\210\345\206\233/project02/libmycal.framework/Versions/A/Headers/ErrroMsg.h" "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/Versions/A/Headers/ErrroMsg.h" new file mode 100644 index 0000000..bbfa8b9 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/Versions/A/Headers/ErrroMsg.h" @@ -0,0 +1,19 @@ +// +// ErrroMsg.h +// cal +// +// Created by Chanjun2016 on 16/10/6. +// Copyright © 2016年 Chanjun2016. All rights reserved. +// + +@interface ErrroMsg : NSObject + ++ (const char *)getYEAR_OUT_RANGE; ++ (const char *)getMONTH_OUT_RANGE; ++ (const char *)getARG_LIMIT_EXCEED; ++ (const char *)getSUCCEED; ++ (const char *)getILLEGALOPTION; + +@end + +/* ErrroMsg_h */ diff --git "a/21651133\351\231\210\345\206\233/project02/libmycal.framework/Versions/A/Headers/libmycal.h" "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/Versions/A/Headers/libmycal.h" new file mode 100644 index 0000000..c1af78f --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/Versions/A/Headers/libmycal.h" @@ -0,0 +1,22 @@ +// +// libmycal.h +// libmycal +// +// Created by Chanjun2016 on 16/10/26. +// Copyright © 2016年 Chanjun2016. All rights reserved. +// + +#import + +//! Project version number for libmycal. +FOUNDATION_EXPORT double libmycalVersionNumber; + +//! Project version string for libmycal. +FOUNDATION_EXPORT const unsigned char libmycalVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import + +#import + diff --git "a/21651133\351\231\210\345\206\233/project02/libmycal.framework/Versions/Current" "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/Versions/Current" new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/Versions/Current" @@ -0,0 +1 @@ +A \ No newline at end of file diff --git "a/21651133\351\231\210\345\206\233/project02/libmycal.framework/libmycal" "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/libmycal" new file mode 100755 index 0000000..2d455ce Binary files /dev/null and "b/21651133\351\231\210\345\206\233/project02/libmycal.framework/libmycal" differ diff --git "a/21651133\351\231\210\345\206\233/project03/MyTaskList.xcodeproj/project.pbxproj" "b/21651133\351\231\210\345\206\233/project03/MyTaskList.xcodeproj/project.pbxproj" new file mode 100644 index 0000000..56f8132 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project03/MyTaskList.xcodeproj/project.pbxproj" @@ -0,0 +1,316 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 6AA911C31DC0B8E6009DFF00 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AA911C21DC0B8E6009DFF00 /* main.m */; }; + 6AA911C61DC0B8E6009DFF00 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AA911C51DC0B8E6009DFF00 /* AppDelegate.m */; }; + 6AA911C91DC0B8E6009DFF00 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AA911C81DC0B8E6009DFF00 /* ViewController.m */; }; + 6AA911CC1DC0B8E6009DFF00 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6AA911CA1DC0B8E6009DFF00 /* Main.storyboard */; }; + 6AA911CE1DC0B8E6009DFF00 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6AA911CD1DC0B8E6009DFF00 /* Assets.xcassets */; }; + 6AA911D11DC0B8E6009DFF00 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6AA911CF1DC0B8E6009DFF00 /* LaunchScreen.storyboard */; }; + 6AA911DA1DC0BF4C009DFF00 /* CJAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6AA911D91DC0BF4C009DFF00 /* CJAppDelegate.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 6AA911BE1DC0B8E6009DFF00 /* MyTaskList.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MyTaskList.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6AA911C21DC0B8E6009DFF00 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 6AA911C41DC0B8E6009DFF00 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 6AA911C51DC0B8E6009DFF00 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 6AA911C71DC0B8E6009DFF00 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 6AA911C81DC0B8E6009DFF00 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 6AA911CB1DC0B8E6009DFF00 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 6AA911CD1DC0B8E6009DFF00 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 6AA911D01DC0B8E6009DFF00 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 6AA911D21DC0B8E6009DFF00 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6AA911D81DC0BF4C009DFF00 /* CJAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJAppDelegate.h; sourceTree = ""; }; + 6AA911D91DC0BF4C009DFF00 /* CJAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJAppDelegate.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6AA911BB1DC0B8E6009DFF00 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 6AA911B51DC0B8E6009DFF00 = { + isa = PBXGroup; + children = ( + 6AA911C01DC0B8E6009DFF00 /* MyTaskList */, + 6AA911BF1DC0B8E6009DFF00 /* Products */, + ); + sourceTree = ""; + }; + 6AA911BF1DC0B8E6009DFF00 /* Products */ = { + isa = PBXGroup; + children = ( + 6AA911BE1DC0B8E6009DFF00 /* MyTaskList.app */, + ); + name = Products; + sourceTree = ""; + }; + 6AA911C01DC0B8E6009DFF00 /* MyTaskList */ = { + isa = PBXGroup; + children = ( + 6AA911C41DC0B8E6009DFF00 /* AppDelegate.h */, + 6AA911C51DC0B8E6009DFF00 /* AppDelegate.m */, + 6AA911C71DC0B8E6009DFF00 /* ViewController.h */, + 6AA911C81DC0B8E6009DFF00 /* ViewController.m */, + 6AA911CA1DC0B8E6009DFF00 /* Main.storyboard */, + 6AA911CD1DC0B8E6009DFF00 /* Assets.xcassets */, + 6AA911CF1DC0B8E6009DFF00 /* LaunchScreen.storyboard */, + 6AA911D21DC0B8E6009DFF00 /* Info.plist */, + 6AA911C11DC0B8E6009DFF00 /* Supporting Files */, + 6AA911D81DC0BF4C009DFF00 /* CJAppDelegate.h */, + 6AA911D91DC0BF4C009DFF00 /* CJAppDelegate.m */, + ); + path = MyTaskList; + sourceTree = ""; + }; + 6AA911C11DC0B8E6009DFF00 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 6AA911C21DC0B8E6009DFF00 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6AA911BD1DC0B8E6009DFF00 /* MyTaskList */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6AA911D51DC0B8E6009DFF00 /* Build configuration list for PBXNativeTarget "MyTaskList" */; + buildPhases = ( + 6AA911BA1DC0B8E6009DFF00 /* Sources */, + 6AA911BB1DC0B8E6009DFF00 /* Frameworks */, + 6AA911BC1DC0B8E6009DFF00 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = MyTaskList; + productName = MyTaskList; + productReference = 6AA911BE1DC0B8E6009DFF00 /* MyTaskList.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6AA911B61DC0B8E6009DFF00 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0730; + ORGANIZATIONNAME = Chanjun2016; + TargetAttributes = { + 6AA911BD1DC0B8E6009DFF00 = { + CreatedOnToolsVersion = 7.3; + DevelopmentTeam = UL9C9N8227; + }; + }; + }; + buildConfigurationList = 6AA911B91DC0B8E6009DFF00 /* Build configuration list for PBXProject "MyTaskList" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6AA911B51DC0B8E6009DFF00; + productRefGroup = 6AA911BF1DC0B8E6009DFF00 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6AA911BD1DC0B8E6009DFF00 /* MyTaskList */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6AA911BC1DC0B8E6009DFF00 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6AA911D11DC0B8E6009DFF00 /* LaunchScreen.storyboard in Resources */, + 6AA911CE1DC0B8E6009DFF00 /* Assets.xcassets in Resources */, + 6AA911CC1DC0B8E6009DFF00 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6AA911BA1DC0B8E6009DFF00 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6AA911C91DC0B8E6009DFF00 /* ViewController.m in Sources */, + 6AA911C61DC0B8E6009DFF00 /* AppDelegate.m in Sources */, + 6AA911C31DC0B8E6009DFF00 /* main.m in Sources */, + 6AA911DA1DC0BF4C009DFF00 /* CJAppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 6AA911CA1DC0B8E6009DFF00 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6AA911CB1DC0B8E6009DFF00 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 6AA911CF1DC0B8E6009DFF00 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6AA911D01DC0B8E6009DFF00 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 6AA911D31DC0B8E6009DFF00 /* 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_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.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 6AA911D41DC0B8E6009DFF00 /* 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_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.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 6AA911D61DC0B8E6009DFF00 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = MyTaskList/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.chanjun2016.MyTaskList; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 6AA911D71DC0B8E6009DFF00 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = MyTaskList/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.chanjun2016.MyTaskList; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6AA911B91DC0B8E6009DFF00 /* Build configuration list for PBXProject "MyTaskList" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6AA911D31DC0B8E6009DFF00 /* Debug */, + 6AA911D41DC0B8E6009DFF00 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6AA911D51DC0B8E6009DFF00 /* Build configuration list for PBXNativeTarget "MyTaskList" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6AA911D61DC0B8E6009DFF00 /* Debug */, + 6AA911D71DC0B8E6009DFF00 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6AA911B61DC0B8E6009DFF00 /* Project object */; +} diff --git "a/21651133\351\231\210\345\206\233/project03/MyTaskList/AppDelegate.h" "b/21651133\351\231\210\345\206\233/project03/MyTaskList/AppDelegate.h" new file mode 100644 index 0000000..a4bfb10 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project03/MyTaskList/AppDelegate.h" @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// MyTaskList +// +// Created by Chanjun2016 on 16/10/26. +// Copyright © 2016年 Chanjun2016. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git "a/21651133\351\231\210\345\206\233/project03/MyTaskList/AppDelegate.m" "b/21651133\351\231\210\345\206\233/project03/MyTaskList/AppDelegate.m" new file mode 100644 index 0000000..645c61d --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project03/MyTaskList/AppDelegate.m" @@ -0,0 +1,47 @@ +// +// AppDelegate.m +// MyTaskList +// +// Created by Chanjun2016 on 16/10/26. +// Copyright © 2016年 Chanjun2016. 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 { +// [s writeToFile:docPath() atomically:YES]; + // 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/21651133\351\231\210\345\206\233/project03/MyTaskList/Assets.xcassets/AppIcon.appiconset/Contents.json" "b/21651133\351\231\210\345\206\233/project03/MyTaskList/Assets.xcassets/AppIcon.appiconset/Contents.json" new file mode 100644 index 0000000..eeea76c --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project03/MyTaskList/Assets.xcassets/AppIcon.appiconset/Contents.json" @@ -0,0 +1,73 @@ +{ + "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" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git "a/21651133\351\231\210\345\206\233/project03/MyTaskList/Base.lproj/LaunchScreen.storyboard" "b/21651133\351\231\210\345\206\233/project03/MyTaskList/Base.lproj/LaunchScreen.storyboard" new file mode 100644 index 0000000..1fa91aa --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project03/MyTaskList/Base.lproj/LaunchScreen.storyboard" @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651133\351\231\210\345\206\233/project03/MyTaskList/Base.lproj/Main.storyboard" "b/21651133\351\231\210\345\206\233/project03/MyTaskList/Base.lproj/Main.storyboard" new file mode 100644 index 0000000..ef88cf3 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project03/MyTaskList/Base.lproj/Main.storyboard" @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git "a/21651133\351\231\210\345\206\233/project03/MyTaskList/CJAppDelegate.h" "b/21651133\351\231\210\345\206\233/project03/MyTaskList/CJAppDelegate.h" new file mode 100644 index 0000000..59e2365 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project03/MyTaskList/CJAppDelegate.h" @@ -0,0 +1,25 @@ +// +// CJAppDelegate.h +// MyTaskList +// +// Created by Chanjun2016 on 16/10/26. +// Copyright © 2016年 Chanjun2016. All rights reserved. +// + +#import + +NSString *docPath(void); + +@interface CJAppDelegate : UIResponder +{ + UITableView *taskTable; + UITextField *taskField; + UIButton *insertButton; + NSMutableArray *tasks; +} + +- (void)addTask: (id)sender; + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git "a/21651133\351\231\210\345\206\233/project03/MyTaskList/CJAppDelegate.m" "b/21651133\351\231\210\345\206\233/project03/MyTaskList/CJAppDelegate.m" new file mode 100644 index 0000000..1995ba7 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project03/MyTaskList/CJAppDelegate.m" @@ -0,0 +1,129 @@ +// +// CJAppDelegate.m +// MyTaskList +// +// Created by Chanjun2016 on 16/10/26. +// Copyright © 2016年 Chanjun2016. All rights reserved. +// + +#import "CJAppDelegate.h" +#import "ViewController.h" + +NSString *docPath() +{ + NSArray *pathList = NSSearchPathForDirectoriesInDomains( + NSDocumentDirectory, NSUserDomainMask, YES); + return [[pathList objectAtIndex:0] + stringByAppendingPathComponent:@"data.txt"]; +} + +@implementation CJAppDelegate + +- (BOOL)application:(UIApplication *)application +didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ + + NSArray *plist = [NSArray arrayWithContentsOfFile:docPath()]; + if (plist) { + tasks = [plist mutableCopy]; + } else { + tasks = [[NSMutableArray alloc] init]; + } + + CGRect windowFrame= [[UIScreen mainScreen] bounds]; + UIWindow *window = [[UIWindow alloc] initWithFrame:windowFrame]; + [self setWindow:window]; + + _window.rootViewController = [[ViewController alloc] init]; + + CGRect tableFrame = CGRectMake(0, 80, 320, 380); + CGRect fieldFrame = CGRectMake(20, 40, 200, 31); + CGRect buttonFrame = CGRectMake(228, 40, 72, 31); + + taskTable = [[UITableView alloc] initWithFrame:tableFrame + style:UITableViewStylePlain]; + [taskTable setSeparatorStyle: UITableViewCellSeparatorStyleNone]; + + taskField = [[UITextField alloc] initWithFrame:fieldFrame]; + [taskField setBorderStyle:UITextBorderStyleRoundedRect]; + [taskField setPlaceholder:@"Type a task, tap Insert"]; + + insertButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + [insertButton setFrame:buttonFrame]; + [insertButton setTitle:@"Insert" forState:UIControlStateNormal]; + + [insertButton addTarget:self + action:@selector(addTask:) + forControlEvents:UIControlEventTouchUpInside]; + + [[self window].rootViewController.view addSubview:taskTable]; + [[self window].rootViewController.view addSubview:taskField]; + [[self window].rootViewController.view addSubview:insertButton]; + + [[self window] setBackgroundColor: [UIColor whiteColor]]; + [[self window] makeKeyAndVisible]; + + [taskField setEnabled:YES]; + + [taskTable setDataSource:self]; + + [taskTable setDelegate:self]; + +// [taskTable addGestureRecognizer:[[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longTap:)]]; + + return YES; +} + +- (void)applicationDidEnterBackground: (UIApplication *) application +{ + [tasks writeToFile:docPath() atomically:YES]; +} + +- (void)addTask: (id)sender{ + NSString *text = [taskField text]; + if ([text isEqualToString:@""]) { + return; + } + [tasks addObject: text]; + [taskTable reloadData]; + [taskField setText:@""]; + [taskField resignFirstResponder]; +} + +- (NSInteger)tableView:(UITableView *)tableView + numberOfRowsInSection:(NSInteger)section +{ + return [tasks count]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = [taskTable dequeueReusableCellWithIdentifier:@"Cell"]; + if (!cell ) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault + reuseIdentifier:@"Cell"]; + } + NSString *item = [tasks objectAtIndex: [indexPath row]]; + + [[cell textLabel] setText:item]; + [cell addGestureRecognizer:[[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longTap:)]]; + + return cell ; +} + + +- (void)longTap:(UILongPressGestureRecognizer *)gestureRecognizer +{ + CGPoint tmpPointTouch = [gestureRecognizer locationInView:taskTable]; + if (gestureRecognizer.state ==UIGestureRecognizerStateBegan) { + NSIndexPath *indexPath = [taskTable indexPathForRowAtPoint:tmpPointTouch]; + if (indexPath == nil) { + NSLog(@"not tableView"); + }else{ + [tasks removeObjectAtIndex: [indexPath row]]; + [taskTable reloadData]; + } + } +} + +@end diff --git "a/21651133\351\231\210\345\206\233/project03/MyTaskList/Info.plist" "b/21651133\351\231\210\345\206\233/project03/MyTaskList/Info.plist" new file mode 100644 index 0000000..40c6215 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project03/MyTaskList/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/21651133\351\231\210\345\206\233/project03/MyTaskList/ViewController.h" "b/21651133\351\231\210\345\206\233/project03/MyTaskList/ViewController.h" new file mode 100644 index 0000000..16954e4 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project03/MyTaskList/ViewController.h" @@ -0,0 +1,21 @@ +// +// ViewController.h +// MyTaskList +// +// Created by Chanjun2016 on 16/10/26. +// Copyright © 2016年 Chanjun2016. All rights reserved. +// + +#import + +//NSString *docPath(void); + +@interface ViewController : UIViewController + +-(void)longTap:(UILongPressGestureRecognizer *)longRecognizer; + +-(void)copyItemClicked:(id)sender; + +-(void)resendItemClicked:(id)sender; +@end + diff --git "a/21651133\351\231\210\345\206\233/project03/MyTaskList/ViewController.m" "b/21651133\351\231\210\345\206\233/project03/MyTaskList/ViewController.m" new file mode 100644 index 0000000..fce57b4 --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project03/MyTaskList/ViewController.m" @@ -0,0 +1,93 @@ +// +// ViewController.m +// MyTaskList +// +// Created by Chanjun2016 on 16/10/26. +// Copyright © 2016年 Chanjun2016. All rights reserved. +// + +#import "ViewController.h" + +//NSString *docPath() +//{ +// NSArray *pathList = NSSearchPathForDirectoriesInDomains( +// NSDocumentDirectory, NSUserDomainMask, YES); +// return [[pathList objectAtIndex:0] +// stringByAppendingPathComponent:@"data.txt"]; +//} + +NSMutableArray *_tasks; +NSMutableString *s; + +@interface ViewController () +{ + +} + +@property (weak, nonatomic) IBOutlet UITextField *taskField; +@property (weak, nonatomic) IBOutlet UIButton *insertButton; +@property (weak, nonatomic) IBOutlet UITableView *taskTable; + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (IBAction)addTask:(UIButton *)sender { + NSString *text = [_taskField text]; + if ([text isEqualToString:@""]) { + return; + } + [s setString:@"Heool"]; + + [_tasks addObject: text]; + [_taskTable reloadData]; + [_taskField setText:@""]; + [_taskField resignFirstResponder]; +} + +-(BOOL)canPerformAction:(SEL)action withSender:(id)sender{ + if(action ==@selector(copyItemClicked:)){ + return YES; + }else if (action==@selector(resendItemClicked:)){ + return YES; + } + return [super canPerformAction:action withSender:sender]; +} + +-(BOOL)canBecomeFirstResponder{ + return YES; +} + +-(void)resendItemClicked:(id)sender{ + NSLog(@"转发"); + //通知代理 +} +-(void)copyItemClicked:(id)sender{ + NSLog(@"复制"); + // 通知代理 +} + +-(void)longTap:(UILongPressGestureRecognizer *)longRecognizer +{ + if (longRecognizer.state==UIGestureRecognizerStateBegan) { + [self becomeFirstResponder]; + UIMenuController *menu=[UIMenuController sharedMenuController]; + UIMenuItem *copyItem = [[UIMenuItem alloc] initWithTitle:@"完成" action:@selector(copyItemClicked:)]; + UIMenuItem *resendItem = [[UIMenuItem alloc] initWithTitle:@"删除" action:@selector(resendItemClicked:)]; + [menu setMenuItems:[NSArray arrayWithObjects:copyItem,resendItem,nil]]; + [menu setTargetRect: self.view.bounds inView:self]; + [menu setMenuVisible:YES animated:YES]; + } +} + + +@end diff --git "a/21651133\351\231\210\345\206\233/project03/MyTaskList/main.m" "b/21651133\351\231\210\345\206\233/project03/MyTaskList/main.m" new file mode 100644 index 0000000..18254ed --- /dev/null +++ "b/21651133\351\231\210\345\206\233/project03/MyTaskList/main.m" @@ -0,0 +1,17 @@ +// +// main.m +// MyTaskList +// +// Created by Chanjun2016 on 16/10/26. +// Copyright © 2016年 Chanjun2016. All rights reserved. +// + +#import +#import "AppDelegate.h" +#import "CJAppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([CJAppDelegate class])); + } +} \ No newline at end of file