數(shù)組
[array[i] isEqual:array2[i]]
判斷兩個(gè)數(shù)組元素是否相等
[array[i] == array2[i]]
判斷兩個(gè)元素地址是否相等
[array componentsJoinedByString:@"."]
將所有元素之間加入.連接成字符串
enumerateObjectsUsingBlock快速遍歷
sortedArrayUsingComparator排列
reverseObjectEnumerator.allObjects將數(shù)組倒過來(排序)
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];
}