'Cannot execute method in an NSPanel from a separate NSWindow in Objective-C

I have a MacOS Objective-C project with a parent NSWindow and an NSPanel containing a TableView whose delegate and data source is a class called TableController. A Table Controller was placed in the Objects section of MainMenu.xib by cut and paste from another project. Table Controller does not appear in the controls made visible by Show Library. Methods to fill the TableView with data in TableController.m are executed when the parent form is loaded. I am able to execute these methods from a button on the NSPanel with [MetadataView reloadData]; where MetadataView is an outlet for the TableView control on the NSPanel defined as @property (weak) IBOutlet NSTableView *MetadataView; by ctrl-dragging the TableView into TableController.h.

If I try to make the method containing the reloadData command class-level rather than instance level (prefix + rather than -) in order to allow access from the parent form I get the error "Instance variable "MetadataView" accessed in a class method.

How can I make the method containing the reloadData command execute from a button click on the parent window?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source