プレイリストをストリーミングするために使用しようとしていますが、リスト内のアイテムを表示してAVQueuePlayer
いるところから曲を選択できるようにしたいと考えています。UITableView
アイテムが選択されるたびにプレーヤーをリロードしようとしましたが、An AVPlayerItem cannot be associated with more than one instance of AVPlayer
itemArray
完全なアイテムリストです。テーブルアイテムのインデックスclicked = playIndex.
[player removeAllItems];
player=nil;
NSMutableArray *currentItemArray = [NSMutableArray arrayWithArray:itemArray];
for(int i=0;i<playingIndex; i++)
{
[currentItemArray removeObjectAtIndex:0];
}
player = [[AVQueuePlayer alloc] initWithItems:currentItemArray];
[player play]
*また、反復せずにそれらのオブジェクトを削除するためのより良い方法はありますか?removeObjectsAtIndexesを理解できませんでした