MPMediaItem - NSCoding problem with MPMediaItemArtwork
Posted
by z s
on Stack Overflow
See other posts from Stack Overflow
or by z s
Published on 2010-03-15T03:08:41Z
Indexed on
2010/03/15
3:09 UTC
Read the original article
Hit count: 420
Hi,
So MPMediaItem conforms to NSCoding, but it contains a pointer to MPMediaItemArtwork, which doesn't conform to NSCoding. So if I try to archive a MPMediaItem, if that item has some artwork in it, it will not be able to unarchive.
I tried to make a category of MPMediaItemArtwork and make it conform to NSCoding, but I can't seem to do that because we don't have access to the actual UIImage that it stores. Does anyone know of any other creative ways to get around this problem? I want to be able to archive an MPMediaItem, even if it means somehow stripping off the artwork object. Is there a way to make a category of a class to strip away certain functionality (instead of just adding more, like we do with categories)? Or any other clever way to achieve this?
Thanks.
© Stack Overflow or respective owner