9

我正在使用 CarPlay(simulator 10.3.1) 并在 MPPlayableContentDataSource 中实现所有方法,但未调用以下方法。

- (void)contentItemForIdentifier:(NSString *)identifier completionHandler:(void(^)(MPContentItem *__nullable, NSError * __nullable))completionHandler 

有人知道任何原因吗?

4

2 回答 2

0

numberOfChildItemsAtIndexPath:并且contentItemAtIndexPath:是通常使用的同步API。

据我了解,CarPlay 仅contentItemForIdentifier:completionHandler:在您通过beginLoadingChildItemsAtIndexPath:completionHandler.

FWIW,截至 2017 年 3 月的官方 CarPlay 音频编程指南(我没有看到更新的版本,至少没有在线)没有提到异步方法。

于 2019-02-14T14:57:11.723 回答
0

您是否设置了 MPPlayableContentDataSource 的委托和数据源。因为不设置这两个属性,所有与dataSource&delegate相关的方法都不会执行。

于 2017-10-26T07:26:45.890 回答