I'm seeing a similar issue with Repeat Mode - if Repeat Mode is enabled before I get the system player, every song I play plays twice even when I set repeat mode to MPMusicRepeatModeNone. The only way to clear this issue is to bring up the system music app, press the repeat icon (which shows as off) to cycle through to OFF. Once I do that, each song in my app plays once.
Post
Replies
Boosts
Views
Activity
I have the same issue - while the simulator is running I have no internet access. I have to kill the simulator to get internet access back. Has anyone found a solution for this (xcrun simctl erase all didn't work)?
This is happening with code compiled on iOS 16 Xcode 14 running on an iPad Pro running iOS 15.6.1
This is a perfect example of Apple's lack of concern about cleaning up their code and why you can't rely on them to fix reported bugs.
Their focus is always on the next best thing (which is often catching up with the competition).
Find a work around and keep on developing your code.
I've been working around issues in every release since iOS 3.
I used to update immediately to the latest iOS version in the hope that they had fixed some of the bugs I reported.
Instead I found myself an unwilling beta tester for their latest release.
Now, I give everyone else a few weeks to catch the latest bugs before I stick my toe in the water.
This problem isn't limited to Apple - I see the same thing everywhere - I just happened across this error again tonight and it made me sad to think there's nothing any of us can do to make them care about cleaning up their code.
I should also mention that showArtwork is only called when the app gets a notification that the playback item has changed.
The player's queue isn't changing - I load one playlist of songs and as it plays through them I watch memory increase until it's played the last song in the queue. Once it's displayed all of the images once, memory stops growing so it is definitely the UIImages that are being cached. My concern is that a user may select a large playlist which will cause the system to run out of memory. Since it is a one view app it won't get a chance to garbage collect until they go to another app. Any way I can force it to release or clear the cache?
I commented out the line where the UIImageView is set and memory still grows. If I comment out this line memory doesn't grow:
UIImage *artworkImage = [artwork imageWithSize: CGSizeMake (339, 339)];
I even set artworkImage to nil after assigning it to the image view and memory still grows. How do I release artworkImage?
I ran the allocations tools and there are no leaks in my code. However, the memory usage continues to increase as new images are loaded. Nothing I've tried other than manually sending the app to the background clears the memory. The UIImage imageWithSize seems to be the guilty party but even setting that variable to null doesn't clear the memory used. I also found someone else with the same issue:
https://stackoverflow.com/questions/40029628/mpmediaitemartwork-imagewithsize-memory-leak