3

My watch app uses a WKInterfaceController to display a WKInterfaceTable. In case of errors, it displays an alert using presentAlert called in the presented WKInterfaceController.
I have set a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy, because I got earlier the warning:

Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.g. table view bounds, trait collection, layout margins, safe area insets, etc), and will also cause unnecessary performance overhead due to extra layout passes. Make a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy to catch this in the debugger and see what caused this to occur, so you can avoid this action altogether if possible, or defer it until the table view has been added to a window.

Now my app stops at this breakpoint when my WKInterfaceTable is displayed, and an alert should be presented, at

let visibleInterfaceController = WKExtension.shared().visibleInterfaceController
visibleInterfaceController?.presentAlert(withTitle: title, message: message, preferredStyle: .alert, actions: [okAction])       

The stack trace is:
enter image description here

My question is:
What is the reason for this breakpoint, and how can it be avoided?

EDIT:
I just realised that when I try to edit this breakpoint, it shows:
enter image description here
...and I have no idea what it means...

Reinhard Männer
  • 14,022
  • 5
  • 54
  • 116

0 Answers0