开发者

iphone how do you reload a view with different data

Im an iphone noob. I'm not sure if I'm asking this correctly, but I need to be able to reload my view with a different set of data. I have a view that displays days of the week and the hours worked by day for a given project. I need to be able to reload the same view but with say last week's hours for a different project, etc. So, it's not really transitioning between different views (i found a lot of examples of swapping different views), because it's the same view, just different data.

What I'm thinking is having 2 instances of the same UIView. One view is the current view being displayed to user. The other view is a "staging" view where I load the next set of data and then swap the staging with the current view. With this approach, the current view would be re-purposed as the new "staging" view awaiting the next set of data. How would you go about this? How do you maintain a "staging" view on the side? Is this the right way to be thinking of this? I would like to transition or apply some animation between the different weeks.

This project data is one tab in my tabController. I have other tabs for settings, reports, etc. I have been searching google, but Im not sure exactly how to phrase what开发者_开发问答 I'm looking for. I know what I want to accomplish, just not sure how to ask. Can anyone please provide the right terms, or links to examples please? Thanks.


If you are not showing any kind of transition/animation while changing the data, you will not need a staging view. Just change the value of the different objects in your view.

e.g.

Change the text of the labels. Change button title or image of the buttons. Change the segment titles for a segmented control...

etc etc..

you will not even need to refresh the view to see the change the changes will be visible immediately..

only in case of a table view you will need to change the values in the datasource and call reloadData on the table view.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜