Hello everybody,
I am trying to find my way into iPhone programming right now and have one very basic question about view handling that doesn't seem to get covered in any resources I read so far:
What's the best practise when switching views? Of course I know that every application is always sort of memory critical, so I would tend to releasing view objects when switching views and reinstantiating them when I need them again, but on the other hand I don't think that's a very performant way to handle views. So what is your experience and/or advice?
Let's say we have an application that constantly switches views back and forth, like a Twitter app that views single tweets and then switched back to the list view. Would you keep the views that represent the single tweet display in memory or would you unload it with every switch?
[edit] One more "version" of my question: Given the fact that I have some views that I switch constantly and some that I do not switch to that often (like settings), would I pre-instantiate the ones that I use regularly to have them available in the most performant way and the settings dialogs not, because they're not used so often and I can save RAM by doing it this way? That's the way I think I'd do it, but please correct me if there's a better way or if my idea's actually absurd or something.[/edit]
And talking about single objects you want to display: I would instantiate a single view that loads different content objects instead of one view per content object, right?
Any advice is very welcome here, so thanks in advance for your kind answers
If anyone knows a good resource that's covering this very topic I'd be grateful for this too, of course. Be it a book or just a tutorial, I take everything that makes me understand common practises a bit better here
It's not the code thing, but rather the theory here that I need.
Cheers
Arne
I am trying to find my way into iPhone programming right now and have one very basic question about view handling that doesn't seem to get covered in any resources I read so far:
What's the best practise when switching views? Of course I know that every application is always sort of memory critical, so I would tend to releasing view objects when switching views and reinstantiating them when I need them again, but on the other hand I don't think that's a very performant way to handle views. So what is your experience and/or advice?
Let's say we have an application that constantly switches views back and forth, like a Twitter app that views single tweets and then switched back to the list view. Would you keep the views that represent the single tweet display in memory or would you unload it with every switch?
[edit] One more "version" of my question: Given the fact that I have some views that I switch constantly and some that I do not switch to that often (like settings), would I pre-instantiate the ones that I use regularly to have them available in the most performant way and the settings dialogs not, because they're not used so often and I can save RAM by doing it this way? That's the way I think I'd do it, but please correct me if there's a better way or if my idea's actually absurd or something.[/edit]
And talking about single objects you want to display: I would instantiate a single view that loads different content objects instead of one view per content object, right?
Any advice is very welcome here, so thanks in advance for your kind answers
Cheers
Arne