MPMoviePlayerControllerにプレイリストを設定したいのですが、MPMoviePlayerControllerは引数に配列を取るクラスではないとのことで下記のようなコードを書いてみました。
が、やはりエラーが出てしまいます。
どの部分かいけないのでしょうか。
どなたか教えてください、よろしくお願い致します。
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
MovieTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"movieCell" forIndexPath:indexPath]; NSURL *url1 = [NSURL URLWithString:@"http://www.ajisaba.net/motion/dnld.php?fpath=emu.mp4"]; NSURL *url2 = [NSURL URLWithString:@"http://www.ajisaba.net/motion/dnld.php?fpath=penguin.mp4"]; NSArray *urls = [NSArray arrayWithObjects:url1,url2,nil]; for (int i=0; i<urls.count; i++) { urls = urls[i]; MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc]initWithContentURL:urls]; [moviePlayerController setScalingMode:MPMovieScalingModeAspectFit]; [moviePlayerController.view setFrame:CGRectMake(0, 0, 320, 170)]; if([self.movieList indexOfObject:moviePlayerController] == NSNotFound ){ [self.movieList insertObject:moviePlayerController atIndex:indexPath.row]; }} return cell;
}
あなたの回答
tips
プレビュー