假设idsArray存入了多个字符串
let tempArray =idsArray.filter{ (obj) ->Boolin
let indexId:String= obj as! String
return (indexId == "\(model.id)") ? false : true //把idsArray中和model.id相等的元素删除
}
idsArray.removeAllObjects()
idsArray.addObjects(from: tempArray)
其实 return (indexId == "\(model.id)") ? false : true 这个就是把符合要求的数据进行处理
return false可以简单理解为从数组里删掉,当然也可以写另外的条件
selectList存入的是SchoolRoleContentModel,对比其中的值,删掉