Question: I have a dictionary which i convert to a string to store it in a database.

```
        var Dictionary =
    [
        "Example 1" :   "1",
        "Example 2" :   "2",
        "Example 3" :   "3"
    ]

```

And i use the 

```
Dictionary.description

```

to get the string. 

I can store this in a database perfectly but when i read it back, obviously its a string.

```
"[Example 2: 2, Example 3: 3, Example 1: 1]"    

```

I want to convert it back to i can assess it like 

```
Dictionary["Example 2"]

```

How do i go about doing that?

Thanks

Answer: 
What the `description` text is isn't guaranteed to be stable across SDK versions so I wouldn't rely on it.

Your best bet is to use JSON as the intermediate format with [NSJSONSerialization](https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSJSONSerialization_Class/index.html). Convert from dictionary to JSON string and back.
this is exactly what I am doing right now. Considering @gregheo saying "description.text is not guaranteed to be stable across SKD version" description.text could change in format-writing so its not very wise to rely on.

I believe this is the standard of doing it

```
    let data = your dictionary

    let thisJSON = try  NSJSONSerialization.dataWithJSONObject(data, options: .PrettyPrinted)

    let datastring:String = String(data: thisJSON, encoding: NSUTF8StringEncoding)!

```

you can save the datastring to coredata.