2016年4月26日 星期二

iOS筆記:This application is modifying the autolayout engine from a background thread...

全Log:This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.  This will cause an exception in a future release.

原意:你在非主線程動到了UI,可能會造成崩潰。
只要有UI前綴的,包含AlertView類跳窗,更改任何參數都要在主線程

dispatch_async(dispatch_get_main_queue(), ^{
    [self updateUI];
});

2016年4月18日 星期一

iOS筆記:在xcode用data struct遇到的error

載別人code來用時都發現它們的寫法在Xcode7用不了。

創建變數時形態前方要加上struct前綴

即為
myStruct dataA ; //ERROR
struct myStruct dataA ; //OK

轉型態也是
struct myStruct *dataB = (struct myStruct *) dataA;