Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Ploetzeneder

macrumors newbie
Original poster
Oct 15, 2009
7
0
Hello,
i have got some views, and in one view i have got a value. This value I want to send to the next view. How do i do that ?
Is there a kind of constructor ?

Best regards,
Andreas
 
You are thinking about it the wrong way: views don't store data. You save the data into your model via your controller layer then use the controller layer to retrieve it and tell the next view to display it as appropriate. How you do this is entirely dependant on how you have implemented your model layer and controllers.
 
oops ok i wanted to send from one XIB to another XIB.
this are 2 classes so when i start the new class, i want to add more arguments...shall i add the code?
 
i know that this has nothing to do with the mvc, but it is just a small application for a demo.

thanks anyway
 
i know that this has nothing to do with the mvc, but it is just a small application for a demo.

thanks anyway

Well then just add a property to your application delegate, save the value there (using that as your model) and have the second view controller read that to set the value in the user interface when it detects the view is shown.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.