Reputation: 1740
IPhone app, ios 4+. Creating an app with 50+ pages of info and I want to change depending on what time it currently is always using GMT - so if it's 5am in Los angeles and you access the app I would want it to show the info based on the time GMT, not local time.
I was thinking of having a single view and loading the data in from a datasource (webservice perhaps?) and also having a button at the top left and right to allow users to navigate back and forth through the other pages of info.
Would a normal uiview be enough for this or a uinavigationcontroller preferable to accommodate the back and forth options?
Also, the storing of 50+ pages of info (mainly text, some photos and google map coords), this info wouldn't change much so I'm not sure if it should be stored locally through the app or loaded in from the web. Do people generally avoid storing the info locally in the app or is that fine?
Upvotes: 0
Views: 84
Reputation: 41005
[NSDate date] always returns the time in GMT (local time is a function of NSDateFormatter, not the date object itself) so basing functionality on GMT shouldn't be a problem. If you need to display the date in GMT, just remember to set the locale of your NSDateFormatter before printing the date or it will be printed in local time.
A single view approach might work, possibly inside a UIScrollView with paging enabled so that users can swipe back and forth instead of having to press buttons? Apple have a code example for building paged scrollviews that dynamically load and unload pages of content as you scroll them to reduce memory.
UINavigationController could also work, but remember that UINavigationController builds up like a stack of pages, and keeps the underlying view controllers in memory, so that may use up a lot of memory if you aren't careful in the way you design your view controllers (it's a good idea to have lightweight view controllers that don't retain any data themselves, that way when their view is unloaded they hardly take up any memory).
Alternatively if you don't mind targeting iOS5 only, you could use the iBooks-style UIPageViewController that lets users browse through the content pages like a book.
As for storing your data, it sounds like the best approach would be to embed it in the app. Adding web connectivity adds significant technical complexity to a project, so it's really only worth doing if the content needs to change frequently (so frequently that it's inconvenient to release new app-store updates when the content changes).
Upvotes: 1