You cannot save the state of a control in the control itself.
The progress indicator control does not provide access to its animated state, because unlike a text field, the user cannot change the state of the control. You will never encounter a situation where the state of a control changes without your code initiating it. Because it is you who establish his condition, so you must follow him.
Cocoa uses the Model-View-Controller pattern, and the progress indicator is a view. If you save state in a control, you break the MVC pattern.
Your view should always reflect your Model, and the controller must ensure that the view and model are kept in sync.
You must either use Cocoa Bindings to bind the animated state of the progress indicator to the BOOL stored in your model (preferred), or implement code in the controller class to control the animated state of the progress indicator when this change to BOOL is stored in your model.
source share