Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-27-2009, 03:40 PM   #1 (permalink)
Registered Member
 
geeo's Avatar
 
Join Date: Nov 2009
Posts: 30
geeo is on a distinguished road
Question Need help on how to store data

Hi,

I'm new to iphone dev and even if i read some books and do some coding, i'm face to a problem.

My app is GETing data from a webserver with a JSON file. But I'm wondering what is the best way to store datas on the iphone to allow an offline access :
- copy the json file on iphone an read datas from it
- use sqlite
- use coredata
- something else ?

I'm struck for now cause I don't know what's the best way.

TIA
geeo is offline   Reply With Quote
Old 11-27-2009, 05:16 PM   #2 (permalink)
Registered Member
 
Join Date: Nov 2009
Location: London
Posts: 226
_sjc_ is on a distinguished road
Default

How much data are you saving? What type of information does it contain? Will the user want to search it?

The simplest way is probably a .plist. If whichever library you're using turns the JSON into an NSDictionary or NSArray then writing it to disk as a .plist takes a single command.

If you want the data to be searchable -- especially if there's lots of it -- then SQLite is probably you're best bet.

I'd suggest keeping clear of CoreData until you've got a little more experience.
__________________
SimCap - Simple iPhone and iPad Simulator screen capture
_sjc_ is offline   Reply With Quote
Old 11-27-2009, 06:07 PM   #3 (permalink)
Registered Member
 
geeo's Avatar
 
Join Date: Nov 2009
Posts: 30
geeo is on a distinguished road
Default

No, there is not much data :

A team and XX players (with XX less than 50), each player having a few stats (less than 20).

I tried to go with objects :

- Application load :
--- connect to webserver to get the json file
--- create a new instance of my team object (containing a mutable array of player objects)
--- init it with data

But I can't access to it in my application views
geeo is offline   Reply With Quote
Old 11-29-2009, 02:28 PM   #4 (permalink)
Registered Member
 
geeo's Avatar
 
Join Date: Nov 2009
Posts: 30
geeo is on a distinguished road
Default

Ok i find it for the object problem :

Proto7AppDelegate *mainDelegate = (Proto7AppDelegate *)[[UIApplication sharedApplication]delegate];

Btw, have you some tutorial for the use of plist to store persistent data on the iphone ?
geeo is offline   Reply With Quote
Reply

Bookmarks

Tags
coredata, json, newbie, sqlite

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 332
13 members and 319 guests
akacaj, alexP, ClerurcifeDer, Duncan C, givensur, GraffitiCircus, guusleijsten, JmayLive, NetGuru, Paul Slocum, Punkjumper, Sloshmonster, yys
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,114
Posts: 402,883
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:46 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0