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?

답변 (0개)

카테고리

도움말 센터File Exchange에서 Construct and Work with Object Arrays에 대해 자세히 알아보기

제품

릴리스

R2018a

질문:

2020년 5월 13일

편집:

2024년 1월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by