判断数组里面是否包含某个元素array BOOL isbool = [keyArrays containsObject: self.usernameLabel.text]; if (isbool) {//包含 }else{//不包含 }