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?
1 件のコメント
Pierre Harouimi
2024 年 1 月 5 日
編集済み: Matt J
2024 年 1 月 5 日
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Construct and Work with Object Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!