MPMoviePlayerViewController Невозможно одновременно удовлетворить ограничения
У меня есть приложение ios, и оно падает на iPhone X, отлично работает на других iPhone. я использую objective c
с XIB
, Я просмотрел существующие посты на предмет ограничений. Это не помогло. Xcode
версия 9.1 Ошибка, сообщенная на Xcode
Консоль отладки находится ниже. Любая помощь будет оценена. Спасибо и всего наилучшего, Ракеш
Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x60000028bd60 h=-&- v=-&- _UIBackdropContentView:0x7fb5c34588c0.midY == _UIBackdropView:0x7fb5c3404fa0.midY (active)>",
"<NSAutoresizingMaskLayoutConstraint:0x60000028bc20 h=-&- v=-&- _UIBackdropContentView:0x7fb5c34588c0.height == _UIBackdropView:0x7fb5c3404fa0.height (active)>",
"<NSLayoutConstraint:0x600000484510 V:|-(0)-[UIStatusBar_Modern:0x7fb5c34058f0] (active, names: '|':_UIBackdropContentView:0x7fb5c34588c0 )>",
"<NSLayoutConstraint:0x600000484600 UIStatusBar_Modern:0x7fb5c34058f0.height == 0 (active)>",
"<NSLayoutConstraint:0x6000004845b0 V:[UIStatusBar_Modern:0x7fb5c34058f0]-(0)-[UIView:0x7fb5c3431870] (active)>",
"<NSLayoutConstraint:0x60000028eba0 UIView:0x7fb5c3431870.top == _UIBackdropView:0x7fb5c3404fa0.top + 44 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x6000004845b0 V:[UIStatusBar_Modern:0x7fb5c34058f0]-(0)-[UIView:0x7fb5c3431870] (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
Часть кода, где возникает эта проблема, приведена ниже.
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 3.2) {
NSString *baseUrl = [NSString stringWithFormat:@"file://%@//%@", [[NSBundle mainBundle] resourcePath],[self.video valueForKey:@"VideoFile"]];
baseUrl = [baseUrl stringByReplacingOccurrencesOfString:@"/" withString:@"//"];
baseUrl = [baseUrl stringByReplacingOccurrencesOfString:@" " withString:@"%20"];
NewVideoController *videoController = [[[NewVideoController alloc] initWithContentURL:[NSURL URLWithString:baseUrl]] autorelease];
[videoController.view setTranslatesAutoresizingMaskIntoConstraints:YES];
//[videoController.view prepareToPlay];
//[videoController.view setFrame: self.bounds]; // player's frame must match parent's
videoController.view.frame = [[UIApplication sharedApplication]keyWindow].bounds;
//[videoController.view setFrame:CGRectMake(0,150, 320, 200)];
// ...
//[videoController play];
//self.setTranslatesAutoresizingMaskIntoConstraints=YES;
videoController.moviePlayer.useApplicationAudioSession = NO;
//videoController.view.translatesAutoresizingMaskIntoConstraints = NO;
[self presentMoviePlayerViewControllerAnimated:videoController];
}
После продолжения с этой точки останова видеоэкран отображается на техническом симуляторе. На реальном iPhoneX он вылетает.