Почему ActivityViewController отображает ошибки автоматического ограничения в консоли?

Я пытаюсь реализовать кнопку «Поделиться» в своем приложении и, естественно, обратился к UIActivityViewController. По какой-то причине каждый раз, когда я нажимаю кнопку «Поделиться», и она появляется, в моем журнале появляется следующее сообщение:

    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 beta 7/iOS 9? Или я что-то упускаю? Должен ли я беспокоиться об этом?


person cyril    schedule 20.06.2015    source источник
comment
Я получаю ту же ошибку на Xcode beta 7/iOS 9   -  person Ace Green    schedule 30.06.2015


Ответы (1)


Либо:

  1. Это ошибка Apple. Сообщите о ней по адресу https://feedbackassistant.apple.com/, если она все еще в бета-версии
  2. Вы представляете модальное окно из большого контроллера представления (ошибка во фреймах?), а затем ограничение V:[UIView:0x7c0a2fa0(<=528) нарушается.

Стоит ли волноваться?

  1. Это не приведет к сбоям, но все же это признак ошибки программиста, что журнал существует, в идеале вы должны указать приоритеты для ограничений, если вы намеренно хотите их сломать.
person Alistra    schedule 20.06.2015
comment
Я не думаю, что я устанавливал это ограничение, я просто прошел их все - person cyril; 20.06.2015
comment
Попробуйте удалить AllConstraints из кода, или если вы измените его размер программно - не используйте фреймы, сделайте выход на ограничение - person Alistra; 20.06.2015