Reputation: 11
I want to save my view and get it back when we switch off the ipad.
i found a way to convert it into image , but i want to get back it as view, not as image, so my question is " can we convert back an image to view of which already converted from view to image".
or else , is there any other way to save our view as view itself, so i need a solution to this problem,
But i could retain my view when i process over other modules , here i just assigned my view to some other view object and used it when i get back to that class.
but the problem is when we switch off the ipad the application opens newly , it loses the changes , so want to retain my last changed view .
i awaiting for the most welcomed answers. Thanks.
Upvotes: 0
Views: 61
Reputation: 10395
You will have to save data which corresponds to each element in the view, say for example the buttons, labels and other elements and their state and frame.
Alternatively you can define states of the views which can ever be possible in your application. That way you can save the state only and then on launch read the value and recreate the view.
Simple example is a gaming application. Each level can be recreated and one begins to play from the start of a certain level. However they don't resume usually from where one left off.
That said, it doesn't mean that entire state cannot be saved.
Upvotes: 1
Reputation: 6152
No, There is no way to convert an image into a view. What you can do is, you can save the objects inside the view, there values and there position in some file. When you switch off and again switch on the iPad you need to reload it with the saved data.
Upvotes: 2