2015-09-30 7 views
33

Próbuję całkowicie ustawić AVPlayerViewController poprzez storyboardy przez osadzenie w osobnym Kontrolerze widoku.Nie można jednocześnie zaspokoić więzi Ostrzeżenia z AVPlayerViewController osadzonym w storyboardie

Kroki:

  1. Tworzenie aplikacji w jednym widoku Xcode.
  2. Osadzanie VC w nawigatorze Kontroler.
  3. Dodaj pasek narzędzi na dole (przypięty do superView (prowadzący, układ końcowy, przewodnik po dolnej części, wysokość (44))
  4. Dodaj kontener Zobacz w nadrzędnym View Controller. (Przypięty do superView (prowadzący, kończący), góra układ przewodnik, Pasek Top).
  5. Usuń domyślny widok Controller, która pochodzi z widoku kontenera.
  6. Przeciągnij obiekt odtwarzacz AV View Controller z biblioteki obiektów.
  7. Połącz osadzić segue z pojemnika View to odtwarzacz AV View Controller.

BEZ KODU DODANO.

To właśnie mój storyboard wygląda następująco:

enter image description here

View hierarchii:

enter image description here

wszystko przebiega prawidłowo: ale problem jest: Jak tylko go uruchomić dostaję te ostrzeżenia w debuggera:

2015-09-30 12:58:35.904 AVPlayerTest[9352:446772] 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:0x7f93259513b0 h=-&- v=-&- _UIBackdropContentView:0x7f9325860000.width == _UIBackdropView:0x7f932585e990.width>", 
    "<NSLayoutConstraint:0x7f932592bc70 H:|-(14)-[UILabel:0x7f9325925590'Hi-Speed Scrubbing'] (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592bcf0 H:[UILabel:0x7f9325925590'Hi-Speed Scrubbing']-(14)-| (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592b770 H:|-(0)-[_UIBackdropView:0x7f932585e990] (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b7f0 H:[_UIBackdropView:0x7f932585e990]-(0)-| (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b450 H:|-(0)-[UIView:0x7f932585e830] (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932592b4d0 H:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f932592bcf0 H:[UILabel:0x7f9325925590'Hi-Speed Scrubbing']-(14)-| (Names: '|':_UIBackdropContentView:0x7f9325860000)> 

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. 
2015-09-30 12:58:35.905 AVPlayerTest[9352:446772] 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:0x7f93259513b0 h=-&- v=-&- _UIBackdropContentView:0x7f9325860000.width == _UIBackdropView:0x7f932585e990.width>", 
    "<NSLayoutConstraint:0x7f932592bdd0 H:|-(14)-[UILabel:0x7f9325929bb0'Slide your finger up to a...'] (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592be50 H:[UILabel:0x7f9325929bb0'Slide your finger up to a...']-(14)-| (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592b770 H:|-(0)-[_UIBackdropView:0x7f932585e990] (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b7f0 H:[_UIBackdropView:0x7f932585e990]-(0)-| (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b450 H:|-(0)-[UIView:0x7f932585e830] (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932592b4d0 H:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f932592be50 H:[UILabel:0x7f9325929bb0'Slide your finger up to a...']-(14)-| (Names: '|':_UIBackdropContentView:0x7f9325860000)> 

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. 
2015-09-30 12:58:35.906 AVPlayerTest[9352:446772] 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) 
(
    "<NSLayoutConstraint:0x7f932592b5e0 V:|-(>=0)-[UIView:0x7f932585e830] (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932592b660 V:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932592af50 V:[UIView:0x7f932585e830(44)]>", 
    "<NSLayoutConstraint:0x7f9325952c30 'UIView-Encapsulated-Layout-Height' V:[AVAlphaUpdatingView:0x7f932585e310(0)]>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f932592b660 V:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310)> 

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. 
2015-09-30 12:58:35.907 AVPlayerTest[9352:446772] 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:0x7f93259513b0 h=-&- v=-&- _UIBackdropContentView:0x7f9325860000.width == _UIBackdropView:0x7f932585e990.width>", 
    "<NSLayoutConstraint:0x7f932592ba00 H:|-(0)-[UIView:0x7f932585fbc0] (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592ba80 H:[UIView:0x7f932585fbc0]-(0)-| (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592b770 H:|-(0)-[_UIBackdropView:0x7f932585e990] (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b7f0 H:[_UIBackdropView:0x7f932585e990]-(0)-| (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b450 H:|-(0)-[UIView:0x7f932585e830] (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932592b4d0 H:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932582a040 H:|-(14)-[AVButton:0x7f93258609b0](LTR) (Names: '|':UIView:0x7f932585fbc0)>", 
    "<NSLayoutConstraint:0x7f9325829f90 H:[AVButton:0x7f93258609b0]-(15)-[UILabel:0x7f932347dc20'--:--'](LTR)>", 
    "<NSLayoutConstraint:0x7f9325839550 H:[UILabel:0x7f932347dc20'--:--']-(12)-[AVScrubber:0x7f93234a4350](LTR)>", 
    "<NSLayoutConstraint:0x7f932585a2f0 AVScrubber:0x7f93234a4350.right == UILabel:0x7f932583a470'--:--'.left - 12>", 
    "<NSLayoutConstraint:0x7f932580b390 UILabel:0x7f932583a470'--:--'.right == AVButton:0x7f932585e480.left - 15>", 
    "<NSLayoutConstraint:0x7f932586f490 AVButton:0x7f932585e480.right == AVButton:0x7f93234d1790.left - 10>", 
    "<NSLayoutConstraint:0x7f932580b340 AVButton:0x7f93234d1790.right == AVButton:0x7f93234d6540.left - 10>", 
    "<NSLayoutConstraint:0x7f932584c870 AVButton:0x7f93234d6540.right == UIView:0x7f932585fbc0.right - 14>", 
    "<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f9325829f90 H:[AVButton:0x7f93258609b0]-(15)-[UILabel:0x7f932347dc20'--:--'](LTR)> 

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. 
2015-09-30 12:58:35.909 AVPlayerTest[9352:446772] 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:0x7f93259513b0 h=-&- v=-&- _UIBackdropContentView:0x7f9325860000.width == _UIBackdropView:0x7f932585e990.width>", 
    "<NSLayoutConstraint:0x7f932592ba00 H:|-(0)-[UIView:0x7f932585fbc0] (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592ba80 H:[UIView:0x7f932585fbc0]-(0)-| (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592b770 H:|-(0)-[_UIBackdropView:0x7f932585e990] (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b7f0 H:[_UIBackdropView:0x7f932585e990]-(0)-| (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b450 H:|-(0)-[UIView:0x7f932585e830] (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932592b4d0 H:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932582a040 H:|-(14)-[AVButton:0x7f93258609b0](LTR) (Names: '|':UIView:0x7f932585fbc0)>", 
    "<NSLayoutConstraint:0x7f932586f490 AVButton:0x7f932585e480.right == AVButton:0x7f93234d1790.left - 10>", 
    "<NSLayoutConstraint:0x7f932580b340 AVButton:0x7f93234d1790.right == AVButton:0x7f93234d6540.left - 10>", 
    "<NSLayoutConstraint:0x7f932584c870 AVButton:0x7f93234d6540.right == UIView:0x7f932585fbc0.right - 14>", 
    "<NSLayoutConstraint:0x7f9325859740 H:[AVButton:0x7f93258609b0]-(>=15)-[UILabel:0x7f93234e53f0'Live Broadcast'](LTR)>", 
    "<NSLayoutConstraint:0x7f932583bea0 UILabel:0x7f93234e53f0'Live Broadcast'.right <= AVButton:0x7f932585e480.left - 15>", 
    "<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f9325859740 H:[AVButton:0x7f93258609b0]-(>=15)-[UILabel:0x7f93234e53f0'Live Broadcast'](LTR)> 

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. 
2015-09-30 12:58:35.910 AVPlayerTest[9352:446772] 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:0x7f93259513b0 h=-&- v=-&- _UIBackdropContentView:0x7f9325860000.width == _UIBackdropView:0x7f932585e990.width>", 
    "<NSLayoutConstraint:0x7f9323520650 H:|-(0)-[UIActivityIndicatorView:0x7f93234e6ee0] (Names: '|':UIView:0x7f93234e6120)>", 
    "<NSLayoutConstraint:0x7f93235206a0 H:[UIActivityIndicatorView:0x7f93234e6ee0]-(10)-[UILabel:0x7f93235203b0'Loading\U2026']>", 
    "<NSLayoutConstraint:0x7f9323520740 H:[UILabel:0x7f93235203b0'Loading\U2026']-(0)-| (Names: '|':UIView:0x7f93234e6120)>", 
    "<NSLayoutConstraint:0x7f9323521f90 H:|-(>=0)-[UIView:0x7f93234e6120] (Names: '|':AVLoadingIndicatorView:0x7f93234e5fb0)>", 
    "<NSLayoutConstraint:0x7f9323510da0 UIView:0x7f93234e6120.centerX == AVLoadingIndicatorView:0x7f93234e5fb0.centerX>", 
    "<NSLayoutConstraint:0x7f932592ba00 H:|-(0)-[UIView:0x7f932585fbc0] (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592ba80 H:[UIView:0x7f932585fbc0]-(0)-| (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592b770 H:|-(0)-[_UIBackdropView:0x7f932585e990] (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b7f0 H:[_UIBackdropView:0x7f932585e990]-(0)-| (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b450 H:|-(0)-[UIView:0x7f932585e830] (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932592b4d0 H:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932582a040 H:|-(14)-[AVButton:0x7f93258609b0](LTR) (Names: '|':UIView:0x7f932585fbc0)>", 
    "<NSLayoutConstraint:0x7f932586f490 AVButton:0x7f932585e480.right == AVButton:0x7f93234d1790.left - 10>", 
    "<NSLayoutConstraint:0x7f932580b340 AVButton:0x7f93234d1790.right == AVButton:0x7f93234d6540.left - 10>", 
    "<NSLayoutConstraint:0x7f932584c870 AVButton:0x7f93234d6540.right == UIView:0x7f932585fbc0.right - 14>", 
    "<NSLayoutConstraint:0x7f932583bbc0 H:[AVButton:0x7f93258609b0]-(>=15)-[AVLoadingIndicatorView:0x7f93234e5fb0](LTR)>", 
    "<NSLayoutConstraint:0x7f932583bc10 AVLoadingIndicatorView:0x7f93234e5fb0.right <= AVButton:0x7f932585e480.left - 15>", 
    "<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f93235206a0 H:[UIActivityIndicatorView:0x7f93234e6ee0]-(10)-[UILabel:0x7f93235203b0'Loading…']> 

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. 
2015-09-30 12:58:35.912 AVPlayerTest[9352:446772] 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:0x7f93259513b0 h=-&- v=-&- _UIBackdropContentView:0x7f9325860000.width == _UIBackdropView:0x7f932585e990.width>", 
    "<NSLayoutConstraint:0x7f9323521f90 H:|-(>=0)-[UIView:0x7f93234e6120] (Names: '|':AVLoadingIndicatorView:0x7f93234e5fb0)>", 
    "<NSLayoutConstraint:0x7f9323510da0 UIView:0x7f93234e6120.centerX == AVLoadingIndicatorView:0x7f93234e5fb0.centerX>", 
    "<NSLayoutConstraint:0x7f932592ba00 H:|-(0)-[UIView:0x7f932585fbc0] (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592ba80 H:[UIView:0x7f932585fbc0]-(0)-| (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592b770 H:|-(0)-[_UIBackdropView:0x7f932585e990] (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b7f0 H:[_UIBackdropView:0x7f932585e990]-(0)-| (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b450 H:|-(0)-[UIView:0x7f932585e830] (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932592b4d0 H:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932582a040 H:|-(14)-[AVButton:0x7f93258609b0](LTR) (Names: '|':UIView:0x7f932585fbc0)>", 
    "<NSLayoutConstraint:0x7f932586f490 AVButton:0x7f932585e480.right == AVButton:0x7f93234d1790.left - 10>", 
    "<NSLayoutConstraint:0x7f932580b340 AVButton:0x7f93234d1790.right == AVButton:0x7f93234d6540.left - 10>", 
    "<NSLayoutConstraint:0x7f932584c870 AVButton:0x7f93234d6540.right == UIView:0x7f932585fbc0.right - 14>", 
    "<NSLayoutConstraint:0x7f932583bbc0 H:[AVButton:0x7f93258609b0]-(>=15)-[AVLoadingIndicatorView:0x7f93234e5fb0](LTR)>", 
    "<NSLayoutConstraint:0x7f932583bc10 AVLoadingIndicatorView:0x7f93234e5fb0.right <= AVButton:0x7f932585e480.left - 15>", 
    "<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f9323510da0 UIView:0x7f93234e6120.centerX == AVLoadingIndicatorView:0x7f93234e5fb0.centerX> 

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. 
2015-09-30 12:58:35.912 AVPlayerTest[9352:446772] 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:0x7f93259513b0 h=-&- v=-&- _UIBackdropContentView:0x7f9325860000.width == _UIBackdropView:0x7f932585e990.width>", 
    "<NSLayoutConstraint:0x7f9323521f90 H:|-(>=0)-[UIView:0x7f93234e6120] (Names: '|':AVLoadingIndicatorView:0x7f93234e5fb0)>", 
    "<NSLayoutConstraint:0x7f9323510d10 H:[UIView:0x7f93234e6120]-(>=0)-| (Names: '|':AVLoadingIndicatorView:0x7f93234e5fb0)>", 
    "<NSLayoutConstraint:0x7f932592ba00 H:|-(0)-[UIView:0x7f932585fbc0] (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592ba80 H:[UIView:0x7f932585fbc0]-(0)-| (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592b770 H:|-(0)-[_UIBackdropView:0x7f932585e990] (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b7f0 H:[_UIBackdropView:0x7f932585e990]-(0)-| (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b450 H:|-(0)-[UIView:0x7f932585e830] (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932592b4d0 H:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932582a040 H:|-(14)-[AVButton:0x7f93258609b0](LTR) (Names: '|':UIView:0x7f932585fbc0)>", 
    "<NSLayoutConstraint:0x7f932586f490 AVButton:0x7f932585e480.right == AVButton:0x7f93234d1790.left - 10>", 
    "<NSLayoutConstraint:0x7f932580b340 AVButton:0x7f93234d1790.right == AVButton:0x7f93234d6540.left - 10>", 
    "<NSLayoutConstraint:0x7f932584c870 AVButton:0x7f93234d6540.right == UIView:0x7f932585fbc0.right - 14>", 
    "<NSLayoutConstraint:0x7f932583bbc0 H:[AVButton:0x7f93258609b0]-(>=15)-[AVLoadingIndicatorView:0x7f93234e5fb0](LTR)>", 
    "<NSLayoutConstraint:0x7f932583bc10 AVLoadingIndicatorView:0x7f93234e5fb0.right <= AVButton:0x7f932585e480.left - 15>", 
    "<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f9323510d10 H:[UIView:0x7f93234e6120]-(>=0)-| (Names: '|':AVLoadingIndicatorView:0x7f93234e5fb0)> 

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. 
2015-09-30 12:58:35.913 AVPlayerTest[9352:446772] 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:0x7f93259513b0 h=-&- v=-&- _UIBackdropContentView:0x7f9325860000.width == _UIBackdropView:0x7f932585e990.width>", 
    "<NSLayoutConstraint:0x7f932592ba00 H:|-(0)-[UIView:0x7f932585fbc0] (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592ba80 H:[UIView:0x7f932585fbc0]-(0)-| (Names: '|':_UIBackdropContentView:0x7f9325860000)>", 
    "<NSLayoutConstraint:0x7f932592b770 H:|-(0)-[_UIBackdropView:0x7f932585e990] (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b7f0 H:[_UIBackdropView:0x7f932585e990]-(0)-| (Names: '|':UIView:0x7f932585e830)>", 
    "<NSLayoutConstraint:0x7f932592b450 H:|-(0)-[UIView:0x7f932585e830] (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932592b4d0 H:[UIView:0x7f932585e830]-(0)-| (Names: '|':AVAlphaUpdatingView:0x7f932585e310)>", 
    "<NSLayoutConstraint:0x7f932582a040 H:|-(14)-[AVButton:0x7f93258609b0](LTR) (Names: '|':UIView:0x7f932585fbc0)>", 
    "<NSLayoutConstraint:0x7f932586f490 AVButton:0x7f932585e480.right == AVButton:0x7f93234d1790.left - 10>", 
    "<NSLayoutConstraint:0x7f932580b340 AVButton:0x7f93234d1790.right == AVButton:0x7f93234d6540.left - 10>", 
    "<NSLayoutConstraint:0x7f932584c870 AVButton:0x7f93234d6540.right == UIView:0x7f932585fbc0.right - 14>", 
    "<NSLayoutConstraint:0x7f932583bbc0 H:[AVButton:0x7f93258609b0]-(>=15)-[AVLoadingIndicatorView:0x7f93234e5fb0](LTR)>", 
    "<NSLayoutConstraint:0x7f932583bc10 AVLoadingIndicatorView:0x7f93234e5fb0.right <= AVButton:0x7f932585e480.left - 15>", 
    "<NSLayoutConstraint:0x7f932594aa10 'UIView-Encapsulated-Layout-Width' H:[AVAlphaUpdatingView:0x7f932585e310(0)]>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7f932583bbc0 H:[AVButton:0x7f93258609b0]-(>=15)-[AVLoadingIndicatorView:0x7f93234e5fb0](LTR)> 

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. 

Przepraszam za długi Log, ale wszystko to pojawia się od razu tak go tym. Czego mi brakuje? Automatyczny układ działa świetnie. Nawet przy rotacji. Dlaczego widzę te ostrzeżenia?

Dodany Sample Project

PS:: Korzystanie z Xcode 7.0

UPDATE

Odznaczenie Shows Playback Controls na AVPlayerViewController w Inspektorze Atrybuty rozwiązuje go jakoś i widzę żadnych ostrzeżeń. Ale potrzebuję kontroli. Wydaje się coraz bardziej jak błąd.

+0

Powiedziałeś, że "autolayout działa świetnie". Czy uruchomiłeś ten kod na wszystkich możliwych urządzeniach/rozmiarach ekranu, aby sprawdzić, czy faktycznie nie działa dla żadnego z nich? W Konstruktorze interfejsów istnieje tryb "Podglądu". –

+0

Podgląd pokazuje tylko widok pustego kontenera. Na symulatorze działa dobrze. –

+0

Dodano przykładowy projekt. –

Odpowiedz

-1

To ostrzeżenie mówi, że użyto jednego ograniczenia, którego nie trzeba używać.

ToolBarHeight domyślnie jest dla wszystkich urządzeń iPhone tutaj użyłeś wysokość ograniczenie dla UIToolBar.Ograniczenie wysokości paska narzędziowego jest tutaj dodatkowe, usuń to ograniczenie, automatycznie usunie ostrzeżenie.

+0

Rozumiem, co oznacza to ostrzeżenie. Ale nie wynika to z ograniczenia wysokości paska narzędzi. Mimo że domyślna wysokość to 44, w razie potrzeby można ją zwiększyć lub zmniejszyć. Dodanie do tego ograniczenia nie powinno stanowić problemu. Co więcej, nie widzę paska narzędzi w żadnym miejscu zalogowanych konfliktów. Ale nadal próbowałem usunąć ograniczenie i to nie pomaga. Otrzymuję dokładnie te same ostrzeżenia. –

1

Pobrałem Twój kod i przyjrzałem się temu. Nie robisz niczego złego. Fakt, że można usunąć zaznaczenie opcji "Kontrola odtwarzania", wskazuje na to, że problem leży w strukturze AVKit. Próbowałem nawet ustawić wartość false w pliku XIB, a następnie wywołując [self setShowsPlaybackControls:YES]; po viewDidAppear: z tymi samymi wynikami. Jest to z całą pewnością błąd Apple i powinieneś zgłosić błąd.

26

W rzeczywistości myślę, że to błąd po stronie Apple.

Znalazłem obejście: ustawiono odtwarzaniePlaybackControls na YES po ustawieniu odtwarzacza AVPlayerViewController.player.

zmodyfikować swoje próbki z następujących linii i nie pojawia się więcej Ograniczenie błąd:

@interface ViewController() 

@property(weak, nonatomic) AVPlayerViewController * playerViewController; 


@end 

@implementation ViewController 

- (void)viewDidLoad { 
    [super viewDidLoad]; 

    NSString *path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"mp4"]; 
    NSURL *url = [[NSURL alloc] initFileURLWithPath: path]; 
    AVPlayer * player = [AVPlayer playerWithURL:url]; 

    self.playerViewController.player = player; 
    self.playerViewController.showsPlaybackControls = YES; 
} 


- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 
    if ([segue.identifier isEqualToString:@"AVPlayerSegue"]) { 
     self.playerViewController = segue.destinationViewController; 
    } 
} 


@end 

Należy pamiętać, że plik test.mp4 zostały dodane do projektu.

+0

Nie jestem pewien co do używania właściwości 'showsPlaybackControls'. Dokumenty mówią: "Nie używaj tej właściwości do zmiany widoczności elementów sterujących odtwarzaniem, gdy kontroler widoku odtwarzacza jest wyświetlany na ekranie, ponieważ tworzy lub niszczy elementy interfejsu użytkownika." A także to nie zadziała, jeśli nie udostępnię adresu URL zasobu dla AVPlayera. Co się stanie, jeśli będę musiał dynamicznie ładować zestaw AVA w czasie wykonywania? W takim przypadku będę musiał skonfigurować interfejs użytkownika przed czymkolwiek innym. Zgodnie z twoją odpowiedzią, na razie rozwiązaniem może być dostarczenie pliku fikcyjnego. To trochę pomaga. –

+0

Nie pomogło mi (wyjątek nadal widoczny) na iPhone6s Plus, iOS9.2. –

+0

też mi nie pomógł – hariszaman

0

Zdałem sobie sprawę, że tak się dzieje, gdy próbujesz przedstawić tę samą instancję AVPlayerViewController (używając silnej właściwości referencyjnej), drugi, trzeci ... itd., A elementy sterujące odtwarzacza nie są resetowane (tj. Postęp nie jest na początku).

Progress bar not in 0:00

Właściwie, jeśli stoją ten sam scenariusz, zanim tapping „Gotowe” spróbuj ponownie przeciągnij pasek postępu na początku i na obecnym AVPlayerViewController. Wtedy problem z układem automatycznym powinien zniknąć!

Zasadniczo problem z Autolayout (problem z Apple na drodze) można naprawić, jeśli zresetowałeś kontrolki przed wyłączeniem kontrolera AVPlayerViewController. Ale co, jeśli chcesz zaprezentować to samo wideo? W moim przypadku chcę zachować odniesienie do AVPlayerItem:

@property (strong, nonatomic) AVPlayerItem *playerItem; 

Ale nie chcę tego katastrofa się wydarzy:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'An AVPlayerItem cannot be associated with more than one instance of AVPlayer' 
*** First throw call stack: 
(0x184035900 0x1836a3f80 0x18a254958 0x18a23fc14 0x100054a2c 0x188d5fe50 0x188d5fdcc 0x188d47a88 0x188d5f6e4 0x188d18294 0x188d58820 0x188d57e1c 0x188d284cc 0x188d26794 0x183fecefc 0x183fec990 0x183fea690 0x183f19680 0x185428088 0x188d90d90 0x1000eea78 0x183aba8b8) 
libc++abi.dylib: terminating with uncaught exception of type NSException 

Więc moje obejście było stworzenie kopii AVPLayerItem za każdym razem Pcham AVPlayerViewController. W ten sposób problem awarii i automatycznego układu zniknął. Jednak wideo jest resetowane za każdym razem, gdy naciskasz odtwarzacz.

AVPlayerViewController *playerViewController = [AVPlayerViewController new]; 
playerViewController.player = [[AVPlayer alloc] initWithPlayerItem:self.playerItem.copy]; 
+0

wygląda obiecująco – elliotrock

1

W moim przypadku pozwalają na iPhone tylko w trybie pionowym natomiast chcę AVPlayerViewController mieć wszystkich kierunkach.

W AppDelegate Mam kodu, który wygląda tak:

public func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> UIInterfaceOrientationMask { 

    if self.window?.rootViewController?.presentedViewController is AVPlayerViewController { 

     return .All 
    } 
    return Device.current.contains(.iPhone) ? [.Portrait, .PortraitUpsideDown] : .All 
} 

Kiedy AVPlayerViewController przedstawiono modally, obrócony do góry i oddalił Wezmę bardzo smiler błędzie stos, który złamał pewne ograniczenia.

Aby obejść ten kod dodałem do mojego RootViewController, który przedstawia również wszelkie wystąpienie AVPlayerViewController w mojej aplikacji:

public override func dismissViewControllerAnimated(flag: Bool, completion: (() -> Void)?) { 

    if let playerViewController = self.presentedViewController as? AVPlayerViewController { 

     playerViewController.showsPlaybackControls = false 
    } 

    super.dismissViewControllerAnimated(flag, completion: completion) 
} 

Zasadniczo Łapię chwile, gdy użytkownik kliknie przycisk odrzucić i użyć obejście znalezione w oryginalnym pytaniu.

1

Niestety ten błąd nadal występuje w ios 10.1. W każdym razie zaobserwowałem, że jeśli przedstawię kontroler widoku z ustawionym parametrem seekTime na 0, błąd nie występuje. Tak więc, moim rozwiązaniem było wstrzymanie odtwarzacza, zachowanie czasu bieżącego, poszukiwanie odtwarzacza do 0, przedstawienie kontrolera i po zakończeniu wykonaj następujące czynności: staraj się zachować czas i zagraj ponownie.

AVPlayer *player; 
AVPlayerViewController *avPlayerController; 
CMTime currentTime; 

- (void)viewDidLoad { 
    [super viewDidLoad]; 

    NSURL *videoURL = [NSURL URLWithString:@"https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"]; 
    player = [AVPlayer playerWithURL:videoURL]; 
    AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:player]; 
    [self.playerView.layer addSublayer:playerLayer]; 
    playerLayer.frame = self.playerView.bounds; 
    avPlayerController = [[AVPlayerViewController alloc] init]; 
    avPlayerController.player = player; 

} 

- (IBAction)fullScreen:(id)sender { 
    [player pause]; 
    currentTime = player.currentTime; 
    [player seekToTime:CMTimeMake(0, 1)]; 

    [self presentViewController:avPlayerController animated:YES completion:^{ 
     [avPlayerController.player seekToTime:currentTime]; 
     [avPlayerController.player play]; 
    }]; 
} 
+0

Po dwóch dniach walki z tym błędem, twoje jedyne obejście działa dla mnie (iOS 10.3). –

Powiązane problemy