2020-01-16 06:53 PM
Hello
Refers to
https://touchgfx.zendesk.com/hc/en-us/articles/360018668232-Step-2-Saving-data
In Screen1Presenter.hpp
model-> saveHour (hour);
How do you get an instance of model?
Also
In Screen1View.hpp
presenter-> saveHour (hour);
How do you get an instance of presenter?
Thank you.
2020-01-18 02:22 AM
I might be wrong about this but the way I do it is to have a function prototype in my .hpp file and then the function itself in the .cpp file.
If you are writing in the .cpp file and the headers for the model and view are already created you should be able to tab-complete on the names.
You might find more inspiration in my video here: https://www.youtube.com/watch?v=SYdyJBehcYY
2020-01-20 12:34 AM
Hello Mr.HP
The pointer was accessible as it was defined in the base class.
Thank you very much.
2020-01-20 02:26 AM
> How do you get an instance of model?
A Presenter already has this instance (in base class, yes). The binding is done in some general bootstrapping code to bind the ONLY instance of model to each active presenter.
And same goes for presenter. A view always has a presenter instance according to the Model-View-Presenter (MVP) software pattern.
/Martin