1

I tried to append two dictionaries together using binary operator += in swift.But it shows an error

"Binary operator '+=' cannot be applied to two Dictionary! operands ".

And the corresponding code is given below

func parser(parser: NSXMLParser, 
   didEndElement elementName: String, 
   namespaceURI: String?, 
   qualifiedName qName: String?) {

            if elementName == "Item" {
                  inItem = false
                 objects += object
             }

     }

Dictionary Declaration is given below

var objects:Dictionary<String,String>! = nil
var object:Dictionary<String,String>! = nil

How can I solve this problem?

Thaneerath
  • 11
  • 4

0 Answers0