因為在iOS10中,方法OSAtomicAdd32,OSAtomicDecrement32已經(jīng)被廢棄电爹,
'OSAtomicIncrement32' is deprecated:first deprecated in iOS 10.0
需要使用對應(yīng)的方法替換嘶卧,具體如下:
1.#import <stdatomic.h>
2.將對應(yīng)的計數(shù)器,由int32_t類型設(shè)置為atomic_int類型
3.OSAtomicAdd32 ?替換->? atomic_fetch_add(&atomicCount,1);
OSAtomicDecrement32 替換-> atomic_fetch_sub(&atomicCount, 1);