摘要:
// // ViewController.m // 06-UIView的常见属性 // #import "ViewController.h" @interface ViewController () // 绿色的view @property (weak, nonatomic) IBOutlet UI 阅读全文
posted @ 2017-08-28 21:12
无天666
阅读(158)
评论(0)
推荐(0)
摘要:
// AppDelegate.h // 01-HelloWorld的实现 // /* 新建工程的时候,Use Core Data:比如本地缓存, Include Unit test:增加单元测试 Include UI test:UI的测试。 AppDelegate.h:代理 AppDelegate.m ViewController.h:控制器 ViewController.... 阅读全文
posted @ 2017-08-28 18:26
无天666
阅读(224)
评论(0)
推荐(0)
摘要:
//Singleton.h // 以后就可以使用interfaceSingleton来替代后面的方法声明。 \表示下一行也是上一行的内容。 #define interfaceSingleton(name) +(instancetype)share##name #if __has_feature(objc_arc) //ARC编译这段 #define implementatio... 阅读全文
posted @ 2017-08-28 14:43
无天666
阅读(281)
评论(0)
推荐(0)
摘要:
// Tools.h #import @interface Tools : NSObject // 一般情况下创建一个单例对象都有一个与之对应的类方法,一般情况下用于创建单例对象的方法名称都以share开头, 或者以default开头 + (instancetype)shareInstance; @end // // Tools.m #import "Tools.h" @i... 阅读全文
posted @ 2017-08-28 14:20
无天666
阅读(252)
评论(0)
推荐(0)
摘要:
// // main.m // 自定义类实现copy #import #import "Person.h" #import "Student.h" int main(int argc, const char * argv[]) { /* 1.以后想让自定义的对象能够被copy只需要遵守NSCopying协议 2.实现协议中的- (id)copyWithZon... 阅读全文
posted @ 2017-08-28 13:38
无天666
阅读(424)
评论(0)
推荐(0)
摘要:
3的图片内存示意图 pBlock指向的是堆中的代码块地址。 阅读全文
posted @ 2017-08-28 11:22
无天666
阅读(276)
评论(0)
推荐(0)
摘要:
// // main.m // Copy内存管理(MRC才有内存管理) // #import int main(int argc, const char * argv[]) { @autoreleasepool { NSString *str1 = @"lnj"; char *cstr = "this is a c strin... 阅读全文
posted @ 2017-08-28 09:49
无天666
阅读(229)
评论(0)
推荐(0)

浙公网安备 33010602011771号