<p>Swift automatically converts <code>NSDictionary</code> as <code>Dictionary<NSObject, AnyObject></code>. If you know that a value stored in a <code>NSDictionary</code> is a string, then you have to cast to <code>String</code>.</p>
<p>The problem in your case is about the value, not the key, so you just have to cast as follows:</p>
<pre><code>category.name = excerciseCategoryDictionary["name"] as String
<pre><code>category.name = excerciseCategoryDictionary["name"] as String?
<p>depending from what's the actual type of the object you are assigning the value</p>
<p>This tip was originally posted on <a href="http://stackoverflow.com/questions/24725708/Type%20'String'%20does%20not%20conform%20to%20protocol%20'NSCopying'%20error%20when%20getting%20object%20from%20NSDictionary/24726140">Stack Overflow</a>.</p>
Get New Tutorials Delivered to Your Inbox
New tutorials will be sent to your Inbox once a week.