I have a class which is a subclass of dynamicprops.
I specify a common get method for each dynamic property by using an anonymous function that references a set method but also provides the name of the property. Similar to the following:
metaprop = obj.addprop(name); metaprop.GetMethod = @(obj) getProp(obj,name);
getProp is defined as the folowing method of the class:
function val = getProp(obj,propertyName) val = obj.(propertyName); end
This ends up throwing an error, "Maximum recursion limit of 501 reached." It seems that even though I am accessing that function from within the get property function, it is still calling the get method. Must be because the actual get method is the anonymous function so it doesn't recognize the getProp as the get method and so calls the anonymous function again for obj.(propertyName) Any better ideas to fix this?