上一页 1 ··· 58 59 60 61 62 63 64 65 66 ··· 167 下一页
摘要: // // ViewController.m // 01-加法计算器 // // 首先找main.m文件,然后找AppDelegate,然后找Main Inteferce主交互故事板,然后加载箭头指向的控制器,然后加载控制器内部的View。 // 连线:按住control拖过去然后配置。 // 类扩展:私有的属性和方法。 #import "ViewController.h... 阅读全文
posted @ 2017-08-29 11:18 无天666 阅读(379) 评论(0) 推荐(0)
摘要: // // ViewController.m // 08-UIView的常见属性(尺寸和位置) // // frame:相对于父控件左上角定位 // bounds:改变长宽,左上角是相对于自己 // center: #import "ViewController.h" @interface ViewController () /** label */ @property (nona... 阅读全文
posted @ 2017-08-29 10:26 无天666 阅读(923) 评论(0) 推荐(0)
摘要: // // ViewController.m // 07-UIView的常见方法 // #import "ViewController.h" @interface ViewController () // 红色的view,通过连线,连线就是把oc代码和UI绑定了。 @property (weak, nonatomic) IBOutlet UIView *redView; /** 红色的... 阅读全文
posted @ 2017-08-29 10:07 无天666 阅读(302) 评论(0) 推荐(0)
摘要: // // 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)
上一页 1 ··· 58 59 60 61 62 63 64 65 66 ··· 167 下一页