Restored window cornerView missing at viewDidLoad

I have a restored window issue; I supposed an operation order. When a window is normally created, its view controller will add a button to a tableView's cornerView - syntheized as per docs https://developer.apple.com/documentation/appkit/nstableview/1535831-cornerview to have the proper shading etc:


//  Pin the corner view button to the header and scroll bar views
guard let cornerView = playitemTableView.cornerView else { return }
cornerView.addSubview(cornerButton)
cornerButton.center(cornerView)


and normally the cornerView will be there and my button is added. All is good.


But when the window is restored on a later run, the guard's is taken and no cornerView then no button?


So the above is wrong but why? It seems for a restored window this property is not yet synthesize?

Restored window cornerView missing at viewDidLoad
 
 
Q