去除数组中重复的对象
NSArray *newArr = [oldArr valueForKeyPath:@“@distinctUnionOfObjects.self"];
强/弱引用
#define WeakSelf(type) __weak typeof(type) weak##type = type; // weak
#define StrongSelf(type) __strong typeof(type) type = weak##type; // strong
由角度转换弧度
#define DegreesToRadian(x) (M_PI * (x) / 180.0)
由弧度转换角度
#define RadianToDegrees(radian) (radian*180.0)/(M_PI)
网友评论