Question: I have [String, AnyObject] dictionary in my code like below one and I want to modify the values inside the "boolArray", but I Xcode throws me "Cannot assign to immutable expression of type 'AnyObject'" error. 

Is there any simple way to change the value of this "boolArray"?

```
var dictionary : NSDictionary = [
        "foo" : 0,
        "bar" : "string",
        "boolArray" : [false, false, false, false, false, false, false, false]  
    ]

dictionary["boolArray"]![0] = true // [!] Cannot assign to immutable expression of type 'AnyObject!'

```

Answer: 
Abizern answer is partly true. You will need to change NSDictionary to NSMutableDictionary. You will also have to change

```
dictionary["boolArray"]![0] = true

```

To

```
dictionary["boolArray"]!.setObject(true, atIndex: 0)

```
The trouble is with your type. `NSDictionary` is immutable. Try declaring it as `NSMutableDictionary` instead.