页面刷新的时候,会停止动画。
iPhone X 适配
ViewController
- 子
ViewController的navigationController是父controller的navigationController
Button
- 如果给
button的同一个事件添加两次handler是什么情况?覆盖还是都能够捕获呢?
[button addTarget:self action:@selector(handler1) forControlEvents:UIControlEventTouchUpInside];
[button addTarget:self action:@selector(handler2) forControlEvents:UIControlEventTouchUpInside];
答案是两个
handler都会执行
- 使用场景
可以在底层给每个button加一些统一的事件处理,比如点击的时候打点
Position, AnchorPoint
the center and position both represent the location of the anchorPoint relative to the superlayer
-
frame是相对于父视图 -
frame是个虚拟的概念,是可以随着position,anchorPoint而变化 - 如果改变
anchorPoint,position是不会变得,所以只能变frame,其实就是将anchorPoint放到position的位置
Xcode
Objective-C
- 类中同时写了属性的
get和set方法是不行的,需要@synthesize -
objc_setAssociatedObjectvalue必须是id类型,不能是基本数据类型 object_getClass(id obj)与[obj class]区别- Type Encoding
- 结构体相关
如下 2 个结构体 SampleA 和 SampleB 在内存上是完全一样的,原因是结构体本身并不带有任何额外的附加信息
struct SampleA {
int a;
int b;
int c;
};
struct SampleB {
int a;
struct Part1 {
int b;
};
struct Part2 {
int c;
};
};
MongoDB
- brew services start mongodb
- brew services stop mongodb













网友评论