Smooth table view like on iPod.app
Im trying to redo the table view in the ipod.app. The one with 2 labels and the cover on the left. I want the same information t开发者_运维知识库here. I mean the cover plus all the other MPMediaItem stuff. Everything works fine. I can build the table and get all the information from the music library I need. My only problem is that my table is far away from being smooth. It lacks. When I remove the MPMediaArtworkItem from the table its super fast. So I guess its a problem with that.
Is there any way to load the MPMediaProperties more faster? Whats the fastest way?
THX in advance :)
The table cell style with an image on the right and two labels one on top of the other is a standard style, so that part should probably have been implemented in a pretty good way by apple. I think the key here is what you are saying that if you remove the image it's smooth. The way that apple achieves good performance in their apps is by pre-generating thumbnails for all the views in all sizes they need them. That's the time consuming bit. That's why the sync with iTunes takes a while because it's making several copies of each album artwork etc. You can do the same or you can make sure you ask for artwork of the same size as the ipod library. I've done this and it is very smooth. The only other way is as Till says to do custom drawing, but that's a lot more work.
If you want a bigger thumbnail of the artwork then there's always the option of pre-generating the thumbnails yourself and store/retrieve them using CoreData. I've done it this way too and it works well. In fact I would extract all the properties I want from the MPMediaItem and store in CoreData and then use NSFetchedResultsController to populate the table.
精彩评论