title: How to assign string to NSDictionary using for loop?
body: <p>So, I retrieve song info using mpmediapicker on my application. I want to assign song info to dictionary so it's easy to populate it to tableview. But I found trouble when assigning value to dictionary on for loop.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>for thisItem in mediaItemCollection!.items as! [MPMediaItem]{
  
          let itemUrl = thisItem.valueForProperty(MPMediaItemPropertyAssetURL)
              as? NSURL
  
          let itemTitle =
          thisItem.valueForProperty(MPMediaItemPropertyTitle)
              as? String
  
          let itemArtist =
          thisItem.valueForProperty(MPMediaItemPropertyArtist)
              as? String
  
          let itemArtwork =
          thisItem.valueForProperty(MPMediaItemPropertyArtwork)
              as? MPMediaItemArtwork
  
  
          playlist = ["title" : itemTitle! , "artist" : itemArtist!, "song_url" : itemUrl!]
  
  
      }
  </code></pre>
  
  <p>and below is what I got:</p>
  
  <pre><code>Optional({
      artist = "ASKING ALEXANDRIA";
      "song_url" = "ipod-library://item/item.mp3?id=5357233978197423496";
      title = Alerion;
  })
  </code></pre>
  
  <p>it's only retrieving the last song. How can I fix this problem ? </p>
  
  <p>the format I want is like below:</p>
  
  <pre><code>Optional({artist = "ASKING ALEXANDRIA";"song_url" = "ipod-library://item/item.mp3?id=5357233978197423496";title = Alerion;}, {artist = "ASKING ALEXANDRIA";"song_url" = "ipod-library://item/item.mp3?id=5357239348197423496"; title = The Prophecy;}, {artist = "ASKING ALEXANDRIA";"song_url" = "ipod-library://item/item.mp3?id=53572339781974234123";title = Breathless;})
  </code></pre>
  
  <p>How can I do that?</p>