title: Experiencing memory leak using UICollectionView and MPMediaItemArtwork
body: <p>I'm building a basic music player application, making use of Apple's MediaPlayer to access the iPod library.  In one of my views, I use UICollectionView to display album art for all albums in the library. When scrolling I'm getting huge increases in memory usage, which I expect, but the usage never decreases, and eventually the app crashes due to memory pressure, topping out at about a few hundred mb in the Xcode debugger.</p>
  
  <p>this is essentially the code I'm using to configure each collectionView cell:</p>
  
  <pre><code>func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {
      let cell = collectionView.dequeueReusableCellWithReuseIdentifier(ALBUM_CELL_REUSE_IDENTIFIER, forIndexPath: indexPath) as! AlbumCollectionViewCell
      cell.configureWithAlbum(albumItems[indexPath.row])
  
      return cell
  }
  
  
  func configureWithAlbum(album: MPMediaItemCollection){
      guard let representItem = album.representativeItem else{
          return
      }
  
      if let albumTitle = representItem.albumTitle{
          if let artwork = AlbumsCollectionViewDataSource.sharedInstance.artworkDict[albumTitle]{
              backgroundImageView.image = artwork.imageWithSize(backgroundImageView.frame.size)
          }
      }
  }
  </code></pre>
  
  <p>So far I have tried to use NSCache to cache the album art, as well as override <code>prepareForReuse</code> and set <code>backgroundImageView.image = nil</code>, but this seems to have no effect.   Additionally, I have a tableview that similarly makes use of a small UIImageviews for cover art which seems to be causing similar issues.</p>
  
  <p>Is it possible that I am obviously overlooking something? For a few hundred cells with small album art I figure this should be possible without a ton of memory usage.</p>
  
  <p>Any help is much appreciated.</p>