頁面刷新的時候,會停止動畫。
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都會執(zhí)行
- 使用場景
可以在底層給每個button加一些統(tǒng)一的事件處理,比如點(diǎn)擊的時候打點(diǎn)
Position, AnchorPoint
the center and position both represent the location of the anchorPoint relative to the superlayer
-
frame是相對于父視圖 -
frame是個虛擬的概念,是可以隨著position,anchorPoint而變化 - 如果改變
anchorPoint,position是不會變得,所以只能變frame,其實(shí)就是將anchorPoint放到position的位置
Xcode
Objective-C
- 類中同時寫了屬性的
get和set方法是不行的,需要@synthesize -
objc_setAssociatedObjectvalue必須是id類型,不能是基本數(shù)據(jù)類型 object_getClass(id obj)與[obj class]區(qū)別- Type Encoding
- 結(jié)構(gòu)體相關(guān)
如下 2 個結(jié)構(gòu)體 SampleA 和 SampleB 在內(nèi)存上是完全一樣的,原因是結(jié)構(gòu)體本身并不帶有任何額外的附加信息
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