Hi all,
I'm using the standard Apple moviePlayer sample code and have customized it to play only podcasts like:
-(IBAction)playPodcast:(id)sender{
movieURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@", podcastURI]];
if (movieURL)
{
if ([movieURL scheme]) // sanity check on the URL
{
// initialize a new MPMoviePlayerController object with the specified URL, and
// play the movie
[self initAndPlayMovie:movieURL];
}
}
}
-(void)initAndPlayMovie:(NSURL *)movieURL1
{
// Initialize a movie player object with the specified URL
MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:movieURL1];
if (mp)
{
// save the movie player object
self.moviePlayer = mp;
[mp release];
// Apply the user specified settings to the movie player object
[self setMoviePlayerUserSettings];
// Play the movie!
[self.moviePlayer play];
}
}
I'm calling "playPodcast" function on click of a tableView cell button. But application is crashing at [self.moviePlayer play]; and it's giving me an error:
*** -[PodcastTableViewCell playPodcast]: unrecognized selector sent to instance 0x10c9b90
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[PodcastTableViewCell playPodcast]: unrecognized selector sent to instance 0x10c9b90'
where PodcastTableViewCell is my podcast tableviewcell identifier.
Can anybody please help?
Thanx in advance.