I am trying to pass swift array of dictionaries to the NSMutableArray. But I am getting error "Cannot convert value of type [[String : Anyobject?]] to expected argument type NSMutableArray". Below is the code:
var ary : [[String:AnyObject?]] = []
var mutableDictionary = [String: AnyObject?]()
for c in buffer {
mutableDictionary.updateValue(c.Name, forKey: "name")
mutableDictionary.updateValue(c.Number, forKey: "phoneNumber")
mutableDictionary.updateValue(c.id, forKey: "id")
ary.append(mutableDictionary)
}
Now passing this "ary" to the Objective C method as a NSMutableArray!
Manager.sharedInstance().List(ary)
Manager.sharedInstance().List(ary as! NSMutableArray).NSMutableDictionarycan't contain optionals, and neither canNSMutableArray. You have to drop the optional onAnyObject.