上一页 1 2 3 4 5 6 7 ··· 41 下一页
摘要: 1. 监听scrollview停止拖拽需要下面两个方法: 2. scrollview的代理为何是weak, 防止循环引用 3. 设置代理,可以拖线设置,也可以代码设置 4. 缩放: 实现delegate方法,设置缩放的view, 设置缩放比例 5. pagingEnabled = YES : 当滑到 阅读全文
posted @ 2020-04-23 13:55 Emyin 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 键值监听 [person addObserver: forKeyPath ] [person removeObserver: forKeyPath】 当监听的属性值发生改变,会调用下面方法: -observeValueForKeyPath: ofObject... 阅读全文
posted @ 2020-04-22 22:53 Emyin 阅读(93) 评论(0) 推荐(0) 编辑
摘要: [person setValue:@"xiaomi" forKeyPath:@"dog.name"]; [person valueForKey:"age"] [person dictionaryWithValuesForKeys:@[@"name",@"age"]]; //模型转字典 forKey和 阅读全文
posted @ 2020-04-22 21:07 Emyin 阅读(81) 评论(0) 推荐(0) 编辑
摘要: [image resizableImageWithCapInsets:UIEdgeInsetMake(imageHeight * 0.5, imageWidth * 0.5, imageHeight * 0.5 -1, imageWidth * 0.5 - 1) resizingMode:UIIMa 阅读全文
posted @ 2020-04-22 20:34 Emyin 阅读(457) 评论(0) 推荐(0) 编辑
摘要: 1. 渐变动画 [UIView beginAnimations:nil context:nil];[UIView setAnimationDuration:1.0]; 改变frame等 [UIView commitAnimation]; [UIView animateWithDuration: an 阅读全文
posted @ 2020-04-22 20:22 Emyin 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 1. 控件为什么用weak修饰:控件已经被UIView强指针指向,如果用strong, 则viewController也将强指针指向控件, 在view销毁时可能无法销毁该控件。 2. command + shift + h : 模拟器回到主界面 command + shift + h(h连按两下) 阅读全文
posted @ 2020-04-19 09:45 Emyin 阅读(344) 评论(0) 推荐(0) 编辑
摘要: https://mp.weixin.qq.com/s/mVxJYiGrfselJx1b9XdvYw 阅读全文
posted @ 2020-04-13 19:56 Emyin 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 1. NSString 通过字符串常量创建,存储在常量区 通过alloc initWithFormat/stringWithFormat创建,存储在堆区,而且不同的平台存储的方式不一样。对于相同的两个创建语句,mac系统会自动对字符串对象优化,但iOS平台就是两个不同对象。不同编译器存储方式也不一样 阅读全文
posted @ 2020-04-12 16:28 Emyin 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 1. Category Category是给原有类增加方法的,不能增加属性 分类中的@property只会生成getter.setter的声明,不会生成方法的实现及成员变量。 分类可以访问原有类.h中声明的属性 如果一个分类有一个方法和原类方法名相同,那么用原类调用该方法是,实际调用的是分类的方法。 阅读全文
posted @ 2020-04-10 20:33 Emyin 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 1. alloc, new,copy一个对象时,对象的引用计数为1 引用计数为0时,才能释放 2. retain +1 release -1 retainCount 不准确 3. 对象引用计数为0需要销毁时,系统会调用-(void)dealloc方法,必须先调用[super dealloc]且要写在 阅读全文
posted @ 2020-04-09 19:04 Emyin 阅读(127) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 41 下一页