How to move data between two iosViews.

Please tell me how to move data between two iOSViews.
I want to use the number of Property of View1 as the data of View2.

On the screen of View2
Dim i As Integer = View1.Number ?

Add

I want to change it on View 2 and return to View 1.

well in my case I use data holders build a class to hold the data you need and then you push that data to the next view

Create a class to hold the Properties

Example Class DataHolder that has the properties a, b, 5

Create a property in both views with the type as DataHolder

View 1

[code]Add a property m1 with Type DataHolder

Initiate it in Open or where you need like m1 = New DataHolder[/code]

Add same in View2

[code]Add a property m2 with Type DataHolder

[/code]
Populate m in view1 and then push it to view2

To populate in View1 you use

m1.a = Value m1.b = Value m1.c = Value
On the button where you have the switch, in View1 you do something like

[code]Dim v As New View2

v.m2 = New DataHolder
v.m2 = m1

Self.PushTo(v)[/code]

In this way all the data you gathered in view 1 will be available in view2

in view2 you process the data you have in m.2

Value1 = m2.a
and so on.

Hope it helps

[quote=397062:@Aurelian Negrea][/quote]

Thank you
My question was not good.

Move the data of View 1 to View 2.
I want to change it on View 2 and return to View 1.

Is there a good way to do it?

Thank you
My question was not good.

Move the data of View 1 to View 2.
I want to change it on View 2 and return to View 1.

Is there a good way to do it?[/quote]
well same, hold the data and push it between views

Try to make an example and put it here so we can see it that would help.

(View1)
Dim i1 as Integer

(View2)

Dim i2 as Integer
(i2 = View 1.i1)
i2 = i2 +1

I want to use this i2 on View 1

Easiest way to pass data between two views is with a xojo.core.dictionary
It can hold any kind of data.
Other option is to create your own class.

View1, add a property named dicData As xojo.core.dictionary

View2, add a property named dicData as xojo.core.dictionary

View2, add a method named Constructor :

[code]Public Sub Constructor(dicData as xojo.core.dictionary)

self.dicData = dicData

// Calling the overridden superclass constructor.
Super.Constructor

End Sub
[/code]

In View1 when you need to show View2:

Dim v as new View2(self.dicData) self.pushto(v)

Any changes to dicData in View2 will also be available in View1.

quote=397066:@DAISUKE FUJIO
Dim i1 as Integer

(View2)

Dim i2 as Integer
(i2 = View 1.i1)
i2 = i2 +1

I want to use this i2 on View 1[/quote]

See this quick sample , of course it can be faster and there are other ways, or you can use Jeremie’s way . Here you have a field and you can move the data around the views.

Hope this is easy .

Dear Jeremie-san,
Thanks for your reply.

Can I ask you deeply question about
“Pinch and Zoom examples? “
Link:
(You had responded to Art Gorski on Mar 29.)

Can I move the magnified objects by dragging after the pinch out ?

Regards,

Dear Aurelian -san,
Thank you your comment.

I will use the method of Mr.Jeremie Leroy in this time.

[quote=397097:@DAISUKE FUJIO]Dear Jeremie-san,
Thanks for your reply.

Can I ask you deeply question about
“Pinch and Zoom examples? “
Link:
(You had responded to Art Gorski on Mar 29.)

Can I move the magnified objects by dragging after the pinch out ?

Regards,[/quote]
You should respond to that thread with the question in case someone else has the same question later so everything is connected :slight_smile:

Dear Jeremie-san

I am sorry.
I ask you a question in the original thread again.

Dear Jeremie-san,

Dim v as new View2(self.dicData)
self.pushto(v)

I got an error with (self.dicData)
What will be wrong?