문제

During the testing of my app i discovered that it crashed on an iphone with OS 3.0.1 and 3.1.1(iPod Touch).

I have the following code for playing the video which is placed on a remote server. It works flawlessly on the iOS 4.0 and iPad with OS 3.2

Xcode is setup to use SDK 4.0 but target OS is 3.0.

NSURL *url = [NSURL  URLWithString:selectedLink];  
MPMoviePlayerViewController *moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:url]; 
[self presentMoviePlayerViewControllerAnimated:moviePlayer];
[moviePlayer release];

When run on 3.0.1 and 3.1.1 I receive the following error:

-[UIViewController presentMoviePlayerViewControllerAnimated:]: unrecognized selector sent to instance 0x231550
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:  -[UIViewController presentMoviePlayerViewControllerAnimated:]: unrecognized selector sent to instance 0x231550'

Hope you guys can help me.

도움이 되었습니까?

해결책

MPMoviePlayerViewController has been added recently and is available in iPhone OS 3.2 and later.

You should use MPMoviePlayerController.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top