GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
11/26/16 06:15 PM (8 years ago)

Compile Error: did you mean 'AVPlayerViewController (Xcode 8.1)

Howdy, So, it's time to get back into the game and update my apps. I downloaded a fresh version of one of my apps, and also tried this on somebody else's app as well, and am getting the following three errors: /Users/markfleming/<app path>/BT_Layout/BT_viewController.m:989:5: Unknown type name 'MPMoviePlayerViewController'; did you mean 'AVPlayerViewController'? /Users/markfleming/<app path>/BT_Layout/BT_viewController.m:989:60: Unknown receiver 'MPMoviePlayerViewController'; did you mean 'AVPlayerViewController'? /Users/markfleming/<app path>/BT_Layout/BT_viewController.m:989:95: No visible @interface for 'AVPlayerViewController' declares the selector 'initWithContentURL:' These are all in BT_viewController.m If I try and make the suggested change to MPMoviePlayerViewController, it eliminates two of the errors, but then leaves me with an error related to the new controller. So, I'm basically stuck. This is the section of code with the issues: //show movie player controller... if(escapedUrl != nil){ [BT_debugger showIt:self message:[NSString stringWithFormat:@"Showing moving player controller%@", @""]]; MPMoviePlayerViewController *moviePlayerController = [[MPMoviePlayerViewController alloc] initWithContentURL:escapedUrl]; [moviePlayerController setModalTransitionStyle:UIModalTransitionStyleCrossDissolve]; //get the navigation controller... //BT_navController *tmpController = [appDelegate getNavigationController]; //[tmpController presentModalViewController:moviePlayerController animated:YES]; //[self.navigationController presentModalViewController:moviePlayerController animated:YES]; [self presentViewController:moviePlayerController animated:TRUE completion:^{}]; } Compiling with iOS 8.4 as target on Xcode 8.1. Neither of the apps I'm having this issue on use or access movies, so I suspect I could comment all this out, but it would be nice to have a cleaner solution. Thanks! Mark
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
11/26/16 09:01 PM (7 years ago)
Hi Mark. In BT_Layout/BT_viewController.m around line 986: Change from this; //show movie player controller... if(escapedUrl != nil){ [BT_debugger showIt:self message:[NSString stringWithFormat:@"Showing moving player controller%@", @""]]; MPMoviePlayerViewController *moviePlayerController = [[MPMoviePlayerViewController alloc] initWithContentURL:escapedUrl]; [moviePlayerController setModalTransitionStyle:UIModalTransitionStyleCrossDissolve]; //get the navigation controller... //BT_navController *tmpController = [appDelegate getNavigationController]; //[tmpController presentModalViewController:moviePlayerController animated:YES]; //[self.navigationController presentModalViewController:moviePlayerController animated:YES]; [self presentViewController:moviePlayerController animated:TRUE completion:^{}]; } To This; //show movie player controller... if(escapedUrl != nil){ [BT_debugger showIt:self message:[NSString stringWithFormat:@"Showing moving player controller%@", @""]]; AVPlayerViewController *moviePlayerController = [[AVPlayerViewController alloc] init]; [moviePlayerController setModalTransitionStyle:UIModalTransitionStyleCrossDissolve]; //get the navigation controller... //BT_navController *tmpController = [appDelegate getNavigationController]; //[tmpController presentModalViewController:moviePlayerController animated:YES]; //[self.navigationController presentModalViewController:moviePlayerController animated:YES]; [self presentViewController:moviePlayerController animated:TRUE completion:^{}]; } Give it a shot.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
11/26/16 11:11 PM (7 years ago)
That did the trick! You rock! I hope you had an awesome Thanksgiving! Mark
 
miku
Aspiring developer
Profile
Posts: 405
Reg: Feb 20, 2014
zagorje ob savi
10,600
like
11/27/16 03:11 AM (7 years ago)
My app, compiled with Xcode 8.1 was refused until I added NSPhotoLibraryUsageDescription in info.plist, despite I don't use any photos in app. But OneSignal Push notifications doesn't work. Looks I have to install older Xcode????
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
11/27/16 03:57 PM (7 years ago)
Good fix gang. This and a zillion other things need to be updated on the download server. The project being downloaded is horribly outdated (as we all know)... The NSPhotoLibraryUsageDescription key is easy (a few other keys like this should be in the .plist) but some of the other are more extensive. Especially some issues with the BT_downloader class. Ahhhhhhh gotta love Apple!
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
11/27/16 07:24 PM (7 years ago)
Thanks, @miku! David - any ETA on when we may expect an update on the iOS code? Like Smug mentioned in a recent post, iOS 10 is causing us some serious issues. Thanks! Mark
 
mutzy
Aspiring developer
Profile
Posts: 841
Reg: Nov 03, 2010
Medford, MA
9,860
like
11/28/16 11:45 AM (7 years ago)
Maybe a new updated download package for the holidays?!? Josh
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
12/04/16 08:12 PM (7 years ago)
Thanks Red Dog!!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.