2015-10-26 8 views
33

La mia app interrompe un vincolo quando presento la barra di stato "Call-in" premendo Command + Y nel simulatore. Succede solo la prima volta che presenta la barra del call-in. Tutto sembra come si suppone, ma le stampe di registro il seguente:| - (20) - [UIInputSetContainerView si interrompe quando viene visualizzata la barra di stato di chiamata

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. 
(
    "<NSLayoutConstraint:0x7fb4cb9b2b60 V:|-(20)-[UIInputSetContainerView:0x7fb4cb9b1190] (Names: '|':UITextEffectsWindow:0x7fb4cba003f0)>", 
    "<NSLayoutConstraint:0x7fb4cb942100 'UIInputWindowController-top' V:|-(0)-[UIInputSetContainerView:0x7fb4cb9b1190] (Names: '|':UITextEffectsWindow:0x7fb4cba003f0)>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7fb4cb9b2b60 V:|-(20)-[UIInputSetContainerView:0x7fb4cb9b1190] (Names: '|':UITextEffectsWindow:0x7fb4cba003f0)> 

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. 

Questo è lo stack di chiamate quando si rompe per UIViewAlertForUnsatisfiableConstraints:

* thread #1: tid = 0x17582f, 0x0000000109bbb4c6 UIKit`UIViewAlertForUnsatisfiableConstraints, queue = 'com.apple.main-thread', stop reason = breakpoint 3.1 
    frame #0: 0x0000000109bbb4c6 UIKit`UIViewAlertForUnsatisfiableConstraints 
    frame #1: 0x0000000109bbb8b2 UIKit`-[UIView(UIConstraintBasedLayout_EngineDelegate) engine:willBreakConstraint:dueToMutuallyExclusiveConstraints:] + 113 
    frame #2: 0x0000000107ea672b Foundation`-[NSISEngine handleUnsatisfiableRowWithHead:body:usingInfeasibilityHandlingBehavior:mutuallyExclusiveConstraints:] + 489 
    frame #3: 0x0000000107d07801 Foundation`-[NSISEngine fixUpValueRestrictionViolationsWithInfeasibilityHandlingBehavior:] + 613 
    frame #4: 0x0000000107d07537 Foundation`-[NSISEngine optimize] + 134 
    frame #5: 0x0000000107d07da4 Foundation`-[NSISEngine withBehaviors:performModifications:] + 245 
    frame #6: 0x0000000109bb5a4b UIKit`-[UIView(AdditionalLayoutSupport) _withAutomaticEngineOptimizationDisabledIfEngineExists:] + 58 
    frame #7: 0x0000000109bb658e UIKit`-[UIView(AdditionalLayoutSupport) updateConstraintsIfNeeded] + 254 
    frame #8: 0x0000000109ba6c46 UIKit`-[UIWindow(UIConstraintBasedLayout) updateConstraintsIfNeeded] + 108 
    frame #9: 0x0000000109bb72a3 UIKit`-[UIView(AdditionalLayoutSupport) _updateConstraintsAtEngineLevelIfNeeded] + 272 
    frame #10: 0x00000001093979b3 UIKit`-[UIView(Hierarchy) layoutBelowIfNeeded] + 845 
    frame #11: 0x000000010936eb8b UIKit`-[UIWindow handleStatusBarChangeFromHeight:toHeight:] + 1284 
    frame #12: 0x0000000109703b5b UIKit`-[UITextEffectsWindow handleStatusBarChangeFromHeight:toHeight:] + 100 
    * frame #13: 0x00000001093726a7 UIKit`+[UIWindow _noteStatusBarHeightChanged:oldHeight:forAutolayoutRootViewsOnly:] + 364 
    frame #14: 0x0000000109303a52 UIKit`-[UIApplication statusBar:willAnimateFromHeight:toHeight:duration:animation:] + 265 
    frame #15: 0x00000001099115bb UIKit`-[UIStatusBar _requestStyleAttributes:animationParameters:forced:] + 885 
    frame #16: 0x0000000109910fbf UIKit`-[UIStatusBar requestStyle:animationParameters:forced:] + 437 
    frame #17: 0x0000000109910d0d UIKit`-[UIStatusBar requestStyle:animated:forced:] + 90 
    frame #18: 0x00000001099160a6 UIKit`-[UIStatusBar statusBarServer:didReceiveStyleOverrides:] + 56 
    frame #19: 0x0000000109904b05 UIKit`_UIStatusBarReceivedStyleOverrides + 45 
    frame #20: 0x0000000109909058 UIKit`_XReceivedStyleOverrides + 33 
    frame #21: 0x0000000110d67fa8 AppSupport`migHelperRecievePortCallout + 208 
    frame #22: 0x000000010896c289 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41 
    frame #23: 0x000000010896c1f9 CoreFoundation`__CFRunLoopDoSource1 + 473 
    frame #24: 0x0000000108961970 CoreFoundation`__CFRunLoopRun + 2272 
    frame #25: 0x0000000108960e08 CoreFoundation`CFRunLoopRunSpecific + 488 
    frame #26: 0x000000010e360ad2 GraphicsServices`GSEventRunModal + 161 
    frame #27: 0x00000001092f330d UIKit`UIApplicationMain + 171 
    frame #28: 0x00000001074e252f AppName`main(argc=1, argv=0x00007fff5872e688) + 111 at main.m:16 
    frame #29: 0x000000010aa6b92d libdyld.dylib`start + 1 
    frame #30: 0x000000010aa6b92d libdyld.dylib`start + 1 

Avete qualche idea del perché le interruzioni di vincolo? Non ho aggiunto alcun vincolo allo UIInputSetContainerView, UITextEffectsWindow o UIInputWindowController.

EDIT: La mia domanda è stato contrassegnato come un possibile duplicato, ma io NON raccomandare o convenire con the answer che viene fornito nella other question. È molto rischioso rimuovere i vincoli di Apple, solo per sbarazzarsi di questo avvertimento. Non raccomanderei di farlo. Questo è il motivo per cui trovo il flag duplicato sbagliato (Questa domanda è stata già chiesta e ha già una risposta.), perché la risposta non è quella che sto cercando.

+3

Quali vincoli hai aggiunto? Sospetto che un vincolo venga aggiunto in fase di esecuzione dal sistema probabilmente a causa di un'impostazione del generatore di interfaccia. I vincoli però sono in conflitto come si può vedere nel registro – Lefteris

+0

c'è la possibilità che la barra di stato spinga la finestra 20px verso il basso? –

+0

@Lefteris Non aggiungo alcun vincolo alle viste con vincoli in conflitto. –

risposta

16

Sembra che si tratti di un bug di Apple. È possibile verificare che succede su un modello di progetto completamente vuote:

  • Crea nuovo singolo progetto di vista
  • Run su iPhone simulatore
  • stampa Cmd-Y per attivare o disattivare la barra di stato

Vedrai la rottura del vincolo.

Il radar è la strada da percorrere direi.

+1

Ottengo la stessa cosa quando si supporta il multitasking. Qualcuno ha depositato un radar che posso ingannare? – Andrew

+1

@Andrew http://www.openradar.me/24764160 (per il multitasking) e http://www.openradar.me/24426241 (per la barra di stato). – imgx64

+0

@ imgx64 grazie, imbrogliato – Andrew

4

Questo è chiaramente un bug di Apple. La mia ipotesi è che abbiano un vincolo errante che mantiene l'altezza delle barre di stato a 20 px ma si rompe quando la barra delle chiamate aumenta. Questo non si interrompe o non influenza l'app in modo che possa essere tranquillamente ignorata per ora. Ma un radar Apple dovrebbe essere riempito.

Problemi correlati