I want to write a function named remove in Swift which will accept an array or a string and remove the string from a dictionary if it is a string else it will remove all the strings from the dictionary which are present in the array. Also, this function that I wrote is disabling the styles in the editor of Xcode.
func remove(key: AnyObject){
if key is Array{
for (index, value) in enumerate(key){
if -1 < self._getDataStoreKeyIndex(value){
self._removeProperty(value)
} else{
self._removeItem(value)
}
}
}else{
if -1 < self._getDataStoreKeyIndex(key){
self._removeProperty(key)
}else{
self._removeItem(key)
}
}
}
The other functions in the code are correct because if I comment this function my project is building successfully. What is wrong in my code?
I am getting a segmentation fault.
<unknown>:0: error: unable to execute command: Segmentation fault: 11