2022-12-20 04:17 AM
Hello everyone,
Im faced with problem. I want to save headline name typed by keyboard
This is how I copy buffer to wildcard
When I sent keyboard[2] to view like this:
And throught presenter I save string to model:
Presenter:
Model:
And in model I create Unicode::UnicodeChar* array like this. Am I doing this right?:
When I store this data to model I take this info in other screen
Here I take headline name and send it to getControllerText function
here is this function:
It is OK how I store Unicode::UnicodeChar* strings? Because when I want to save 2 strings then second string replace first one and it becomes the same. Maybe someone see the problem?
When I store one string:
The second one replace first string and second and I didint see why..
Solved! Go to Solution.
2022-12-20 08:27 AM
No you dont send buff. Debug your code and will see, that in your .Headline is pointer address = kebuff[2]
You need on any transfer stage create strcpy.
Unicode | TouchGFX Documentation
and remove * from Unicode::UnicodeChar in struct
2022-12-20 07:35 AM
I mean no. You send over presenter pointer into keyboard buff and this stay one.
2022-12-20 07:56 AM
AMM, but I send keyboard buff over presenter to model and store them into array.
2022-12-20 08:27 AM
No you dont send buff. Debug your code and will see, that in your .Headline is pointer address = kebuff[2]
You need on any transfer stage create strcpy.
Unicode | TouchGFX Documentation
and remove * from Unicode::UnicodeChar in struct
2022-12-20 10:15 AM
OK. I'll try. Thank you
2022-12-21 02:31 AM
@MM..1 I'm stuck. Here is what I change:
Change struct as you said:
And change code in model.hpp
And this is what i got now:
When I create first with name "1" it is ok. But when I create second and name it "2", the first headline becomes "12" and second "2" and so on. It adding number which I used before and I dont know why.
2022-12-21 03:01 AM
2022-12-21 03:04 AM
It works. Thank you.