Error using arrayviewfunc No public property 'myProperty' for class ''myAPP''
13 views (last 30 days)
Show older comments
Hi, I have buit an app using App Designer.
I got an error when I ran my app: Error using arrayviewfunc No public property 'myProperty' for class ''myAPP''. 'myProperty' is the name of a property defined by me. "myAPP" is the name of my app.
I have 'myProperty' defined as a private property. But even if the property is not used in the later part of my code, I still get the error if I set a breakpoint to run step by step. If there is no breakpoint, the app runs without error prompts.
0 Comments
Answers (1)
Sugandhi
on 6 Jun 2023
Hi Tao Hu,
I understand that you are facing an issue while using App designer.
The error message suggests that there is no public property named 'myProperty' defined for the class "myAPP". The property might have been defined as private and therefore cannot be accessed from outside the class.
Although setting a breakpoint should not cause errors by itself, it is possible that the presence of the breakpoint is affecting the order in which code is executed and this is somehow triggering the error.
The possible work arounds could be as follows:
1. Make sure that the class definition for "myAPP" includes a private property named "myProperty". Check the spelling and capitalization of the property name to ensure it matches the name used in your code.
2. Recheck whether you are accessing the "myProperty" property from outside the class "myAPP". If so, you will need to define a public getter method in the class that returns the value of the private property.
3. Change the access modifier of the "myProperty" property to public. This will allow you to access the property from outside the class without needing to define a getter method.
4. Verify that the error occurs consistently when you set a breakpoint and step through the code. If so, try to isolate the section of code where the error occurs and inspect the values of variables to see if there are any unexpected values that could be triggering the error.
5. If the error does not occur when running the app normally, it is likely that the breakpoint is somehow affecting the order in which code is executed and triggering the error. In this case, try reordering the code or changing the breakpoint to a different location to see if this resolves the issue.
0 Comments
See Also
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!