ioscarplaympplayablecontentdelegate

Carplay: MPPlayableContentDelegate methods never called


After implementing MPPlayableContentDelegate, setting it as the delegate for MPPlayableContentManager, I find that the delegate methods are never called when running on a device or in the iOS simulator. Data from the MPPlayableContentDataSource displays correctly, but when I select an item marked as playable, I see a spinner, followed by the message "There was a problem loading this content." Since I don't have any window into what is happening inside "MPPlayableContentManager" this is hard to debug.

Rather extraordinarily, this was all working successfully for me not long ago, and reverting to older versions of my app does not fix the problem, suggesting that it is due to a recent change in tooling, or (most likely) perhaps an unrelated problem on my end.

Any help would be appreciated.


Solution

  • It turns out that MPPlayableContentManager only retains a weak reference to the content delegate. In doing some cleanup, I had inadvertently removed the strong reference that keep the object from being released. Restoring the strong reference caused the object to be retained and fixed the problem.