頁面刷新的時候鸭廷,會停止動畫。
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)一的事件處理,比如點擊的時候打點
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_setAssociatedObject
value
必須是id
類型咨堤,不能是基本數(shù)據(jù)類型 object_getClass(id obj)
與[obj class]
區(qū)別- Type Encoding
- 結(jié)構(gòu)體相關
如下 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