数组
[array[i] isEqual:array2[i]]
判断两个数组元素是否相等
[array[i] == array2[i]]
判断两个元素地址是否相等
[array componentsJoinedByString:@"."]
将所有元素之间加入.
连接成字符串
enumerateObjectsUsingBlock
快速遍历
sortedArrayUsingComparator
排列
reverseObjectEnumerator.allObjects
将数组倒过来(排序)
Masonry
更新的约束要在指定的方法中
// this is Apple's recommended place for adding/updating constraints
- (void)updateConstraints {
[self.growingButton updateConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(self);
make.width.equalTo(@(self.buttonSize.width)).priorityLow();
make.height.equalTo(@(self.buttonSize.height)).priorityLow();
make.width.lessThanOrEqualTo(self);
make.height.lessThanOrEqualTo(self);
}];
//according to apple super should be called at end of method
[super updateConstraints];
}
网友评论