2015-06-20 26 views
0

我試圖在我的應用程序中實現一個共享按鈕,所以很自然地,我轉向UIActivityViewController。出於某種原因,任何時候我按下分享按鈕,它會彈出,我得到了我的日誌中看到以下消息:爲什麼ActivityViewController在控制檯中顯示自動約束錯誤?

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:0x7c0a65d0 V:[UIView:0x7c0a2fa0(<=528)]>", 
    "<NSLayoutConstraint:0x7c0a6540 UIView:0x7c0a2fa0.height == UIView:0x7c0a2e60.height>", 
    "<NSLayoutConstraint:0x7c0a7100 _UIAlertControllerView:0x7c0a27f0.height == UIView:0x7c0a2e60.height>", 
    "<NSLayoutConstraint:0x7c0b1660 V:[_UIAlertControllerView:0x7c0a27f0(568)]>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7c0a65d0 V:[UIView:0x7c0a2fa0(<=528)]> 

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-06-20 15:32:43.885 App[19268:300248] 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:0x78fc3e70 V:[UIView:0x78ff1eb0(<=528)]>", 
    "<NSLayoutConstraint:0x78fc3de0 UIView:0x78ff1eb0.height == UIView:0x78fb9670.height>", 
    "<NSLayoutConstraint:0x78fc5aa0 _UIAlertControllerView:0x78ff69f0.height == UIView:0x78fb9670.height>", 
    "<NSLayoutConstraint:0x78f58860 V:[_UIAlertControllerView:0x78ff69f0(568)]>" 
) 

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x78fc3e70 V:[UIView:0x78ff1eb0(<=528)]> 

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-06-20 15:32:48.691 App[19268:300248] viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=0x79982700 {Message=Service Connection Interrupted} 

調用它時我沒有做任何幻想,只是最低限度:

let someText:String = "Hello" 
     let activityViewController = UIActivityViewController(activityItems: [someText], applicationActivities: nil) 
     activityViewController.excludedActivityTypes = [ 
      UIActivityTypePostToWeibo, 
      UIActivityTypePrint, 
      UIActivityTypeCopyToPasteboard, 
      UIActivityTypeAssignToContact, 
      UIActivityTypeSaveToCameraRoll, 
      UIActivityTypeAddToReadingList, 
      UIActivityTypePostToFlickr, 
      UIActivityTypePostToVimeo, 
      UIActivityTypePostToTencentWeibo 
     ]   self.navigationController!.presentViewController(activityViewController, 
      animated: true, 
      completion: nil) 

這會是從Xcode中的β7/9的iOS錯誤?或者我錯過了什麼?我應該擔心嗎?

+0

我得到相同的錯誤Xcode中的β7/9的iOS我 –

回答

0

或者:

  1. 這是一個蘋果的錯誤 - 因爲它仍處於測試階段它只要報http://radar.apple.com
  2. 您從一個超大的視圖控制器(以幀錯誤?),然後呈現模式限制V:[UIView:0x7c0a2fa0(<=528)中斷

你應該擔心嗎? 1.它不會導致崩潰,但它仍然是一個程序員錯誤的跡象,日誌在那裏,理想情況下,如果你故意要打破它們,你會提供約束的優先級

+0

不認爲我放置在約束,我只是通過他們都去 – cyril

+0

從代碼嘗試removeAllConstraints,或者如果你調整它編程 - 不要使用框架,使一個出口的限制 – Alistra

相關問題