摘要: // .h文件#define HMSingletonH(name) + (instancetype)shared##name;// .m文件#if __has_feature(objc_arc) #define HMSingletonM(name) \ static id _instac... 阅读全文
posted @ 2015-08-07 11:54 Lee_M 阅读(196) 评论(0) 推荐(0) 编辑
摘要: // .h文件#define HMSingletonH(name) + (instancetype)shared##name;// .m文件#define HMSingletonM(name) \static id _instance; \ \+ (id)allocWithZone:(struct ... 阅读全文
posted @ 2015-08-07 11:29 Lee_M 阅读(99) 评论(0) 推荐(0) 编辑
摘要: // .h文件#define HMSingletonH(name) + (instancetype)shared##name;// .m文件#define HMSingletonM(name) \static id _instance; \ \+ (id)allocWithZone:(struct ... 阅读全文
posted @ 2015-08-07 11:14 Lee_M 阅读(111) 评论(0) 推荐(0) 编辑
摘要: MusicTool.h 文件#import @interface MusicTool : NSObject+(instancetype)sharedMusicTool;@endMusicTool.m 文件#import "MusicTool.h"@implementation MusicToolst... 阅读全文
posted @ 2015-08-06 17:48 Lee_M 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 什么是gcd全称 Grand Central Dispatch 可译为 中枢调度器纯c语言优点:苹果公司为多核的并行运算提出的解决方案gcd会自动利用更多的cpu内核gcd会自动管理线程的生命周期(创建线程、调度任务、销毁线程 )程序员只需要告诉gcd想要执行什么任务,不需要编写任何线程管理代码gc... 阅读全文
posted @ 2015-08-06 12:07 Lee_M 阅读(222) 评论(0) 推荐(0) 编辑
摘要: #import @interface ViewController : UIViewController@property (weak, nonatomic) IBOutlet UISwitch *leftswitch;@property (weak, nonatomic) IBOutlet UIS... 阅读全文
posted @ 2015-05-18 18:25 Lee_M 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 你可以修改xcode工程文件模板,xcode 6 下的ios文件模板位置是/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode。 阅读全文
posted @ 2015-05-17 15:18 Lee_M 阅读(133) 评论(0) 推荐(0) 编辑
摘要: //// ViewController.m// 代码复习//// Created by app on 15/5/17.// Copyright (c) 2015年 app. All rights reserved.//#import "ViewController.h"@interface ... 阅读全文
posted @ 2015-05-17 14:58 Lee_M 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 计算器简单练习: frame 用法与NSRect CGRect用发相似 它包括 x , y , widht ,height 该view在父view坐标系统中的位置和大小(参照点是父亲的坐标系统) bounds :该view在本身坐标系统中 的位置和大小。(参照点是本身坐标系统)所以一般情况下x... 阅读全文
posted @ 2015-05-04 14:00 Lee_M 阅读(163) 评论(0) 推荐(0) 编辑
摘要: #import void stringCreate1(){ NSString *str1=@"1"; NSLog(@"%@",str1); NSString *str2=[[NSString alloc]initWithFormat:@"2"]; NSLog(... 阅读全文
posted @ 2015-04-30 11:35 Lee_M 阅读(140) 评论(0) 推荐(0) 编辑