What is the most efficient workflow for this iOS app?

I have an application that requires the Internet to synchronize a web service with local base db data. Then db local fetch is used to populate various objects for MapView and TableView in the tabbar controller. I look at these 2 scenarios:

Appflowlowlogic

The main advantage of "A" is that I do not need to pre-load the application using the database, although this is a small dB (about 100 entries). The problem is that it is confusing. If there is no Internet connection, the user sees the map in MapView, but refreshButton is disabled. So this is not a problem. But the user can still go to tableview, and he will see an empty table.

The main advantage of "B" is that with db preinstalled, the application will always have a data source ready for building and printing. I really don't know how to preload the application using db.

I kind of want to go on the first route "A". My main question is that now I have disabled refreshButton on MapView, so that it only works after receiving data from the Internet ... that sortedArray is empty at startup. Therefore, if the user navigates to TableVC, he will be empty. In this case, the user must first click the refresh button before proceeding to the table view.

What is the most effective way to handle this?

+6
source share
1 answer

If 100 entries are static enough that you can send the default recordset using the application, this would be the best solution. The user, with or without the Internet, receives a populated table.

Submit your entries as plist in your application. At the first start, open plist and add each record as a new object to the master data. This type of "sowing" is very fast. Just create a collection (array, dictionary) for plist, then list it by matching it with the managedObject attributes.

Here is the code that shows you how to do this in the WWDC 2012 iCloud and Core Data video (just ignore the iCloud part).

Then, if there is a connection after seeding, you can synchronize the data, which will update / replace / etc pre-populated data.

+2
source

All Articles