Along my journey of writing code for iPhone and iPad apps, I’ve been contributing to a discussion board among a group of App designers.  In the hope that this info helps others – here you go!

 

MANAGING DATA in your APP

(and links to videos with step-by-step instructions)

As you probably already know, in most any app you’re going to have to figure out how you want to manage your data.   With a small amount of data, you can handle it straight in your code with an array or dictionary. Once you start managing a lot of information, you’re most likely going to want to branch out with other tools.

Options explored in this article:

  1. use a plist file
  2. use core data
  3. use sql database (create on your website and link to your app)
  4. and of course, you can also just use an array / dictionary in your code

 

 

Option 1. PLIST file (Property List file)

What is it? It’s a file in XML format. If you’ve ever seen html code, it looks very similar to this but instead of a <tag> it has a <key> and data such as <string> or <integer>.  I’ll go more into this in a future blog post, but for now, here’s some videos to get you started:

Example One – PLIST

This is a very simple video (but no voice). They start with creating the file (like I explained above), and then adding data from there. They provide a link to download the source code.

<Update 5/2016 – This video has been removed from YouTube>
https://www.youtube.com/watch?v=aF3lZldTw4I

 

Example Two – PLIST

In this video, things are explained better and it has voice (how to access file, how to write and read data using code).

https://www.youtube.com/watch?v=3Oy-evy2xD8

 

Note these are all in Objective-C. The actual plist file is the same in Objective-C or Swift once it’s created. I think manual creation outside of the app is easier in many ways if you already have your data. I’ll cover that in my next post.

 

 

Option 2. Core Data

 

First off , here’s some basic tutorials on using core data (you know – that little check box when you first create your project). Here’s two for you:

<UPDATE (5/2016) – This video has been removed from YouTube>
https://www.youtube.com/watch?v=4ymz6i07DRM

Note that this is an earlier version of Xcode, so some things have changed (push is now show, and I created a navigation bar on view controller first, then added segue).

Second video:

http://jamesonquave.com/blog/core-data-in-swift-tutorial-part-1/

 

 

Option 3. SQL Database

Tutorial One:

I like this guy. I’ve done a bunch of his Obj C Tutorials too…

https://www.youtube.com/watch?v=MBD2uV5LvAM

 

Tutorial Two:

This one includes setting up server / briefly watched but didn’t go through all of it but should help newbies

https://www.youtube.com/watch?v=FYElY4ewq_o

 

Here’s info for the website side of things (if you need a refresher) Includes PHP

http://www.sitepoint.com/php-amp-mysql-1-installation/

 

And here’s another one if you’re using WordPress. I’ve never used GatorHost, I usually use GoDaddy but the cPanel stuff is all the same.   This walks you through setting up the access and then creation. It has nothing to do with the app, but you have to do this first to get to the data!

https://www.youtube.com/watch?v=wtG1IJ1Wbvs

I plan to do a more detailed post on this subject as well.

 

Option 4. Arrays and Dictionaries

Lastly, if you just want to use an array (or dictionary) to manage your data, there’s tons of great sample projects out there. When I was first learning apps I used this a lot.

Tutorial One:

This guy is pretty fast and goes through a lot – so I like that! He has a bunch of videos on YouTube. This should get you started…
https://www.youtube.com/watch?v=war0gHL26ns

Tutorial Two:
Here’s another good one – starts with setting up table (adding table view to view controller,

using UITableViewDataSource instead of UITableViewController) and then walks how to add data in subsequent videos:
https://www.youtube.com/watch?v=s78ndDj8K3U

Tutorial Three:

Here’s one using struct and array to pass data:

https://www.youtube.com/watch?v=pR6dR-vVZeY