Ignoring Listeners when loading an object?

I have a class object that has listeners linked to it by an object manager class. The listeners are not necessary or instrinsic to the objects themselves, the manager just uses it to keep track of changes to the objects. I want to be able to save and re-load the objects, however, everytime I do this I get spammed with warnings such as
An invalid default object has been detected while loading a heterogeneous array of
class event.listener. An empty array of class event.listener will be returned.
And
Warning: While loading an object of class 'listener':
No constructor 'event.listener' with matching signature found.
Other than that the load seems to succeed. I have tried defining both a saveobj and loadobj method for the class where the saveobj method returns a struct with property values and the load object created a default class obj with a class constructor with no arguments and then fills in the properties from the struct but I still get these errors.
Short or doing something with warnstruct and lastwarn to hide the messags, how do resolve this?

Risposte (0)

Categorie

Scopri di più su Construct and Work with Object Arrays in Centro assistenza e File Exchange

Prodotti

Release

R2018a

Richiesto:

il 13 Mag 2020

Modificato:

il 5 Gen 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by