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-06-2011, 03:01 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2011
Location: Barcelona
Posts: 5
micharadi is on a distinguished road
Default An iPhone idea (sketched) but what technique is most appropriate

Hello there,

I am new to iPhone Development and I have an idea which I would like to implement but I don't know the most appropriate way to do it. My App has a great number of texts (data) that must be loaded into the App. Roughly around 200,000 words. A CoreData-based app.

I have attached a sketch I drew to show you and clarify my point. The sketch will make you understand where my concern lies.

I found a great sample code which I can use to EXACTLY implement my idea. Writing an XML file that holds all of my text data and then fetched into the App.

But my question is: Is there a better way to do it? Or in other words, what's the best technique for using such an App?

Many thanks in advance. I'd appreciate any help!

Micha
Attached Images
File Type: jpg iPhone idea.jpg (69.5 KB, 46 views)
micharadi is offline   Reply With Quote
Old 11-06-2011, 08:47 AM   #2 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by micharadi View Post
Hello there,

I am new to iPhone Development and I have an idea which I would like to implement but I don't know the most appropriate way to do it. My App has a great number of texts (data) that must be loaded into the App. Roughly around 200,000 words. A CoreData-based app.

I have attached a sketch I drew to show you and clarify my point. The sketch will make you understand where my concern lies.

I found a great sample code which I can use to EXACTLY implement my idea. Writing an XML file that holds all of my text data and then fetched into the App.

But my question is: Is there a better way to do it? Or in other words, what's the best technique for using such an App?

Many thanks in advance. I'd appreciate any help!

Micha
Using a tab bar controller is quite reasonable for this type of app. As long as the number of categories (classical writers, SciFi writers, adventure writers) is small and fixed, it should work great. Tab bar controllers support a more button when the number of tabs gets large, but I don't really like it.

Another alternative to your structure would be to use a table view for your top-level list of items. Each list item would select one of your categories of content.

By the way, I would not have your app import 200,000 records from an XML file on launch. XML is actually a pretty bad way to store large amounts of data. It makes the data much larger, and is slow to process and requires a great deal of memory.

I would suggest setting up Core Data to use SQLite as it's "backing store". In development, populate your database however you want to (on your Mac, even, since it is faster and has much more disk space and memory.)

Once you have your SQL database ready, copy it into your application's resources folder.

Then in your app delegate's init method, write NSFileManager code that checks to see if the SQL database exists in the documents directory. If it doesn't, copy it over from the bundle. Then drop into code that opens the file in the documents directory.

That's what our "Kevin and Kell" cartoon reader app does.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 11-07-2011, 11:47 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2011
Location: Barcelona
Posts: 5
micharadi is on a distinguished road
Default

Thank you Mr. Duncan.

But I've got zero knowledge in how to work with SQLite Database. I will start looking for good tutorials on the internet. If you know some good materials, please do tell me.

I appreciate it.

Micha.
micharadi is offline   Reply With Quote
Old 11-07-2011, 02:10 PM   #4 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 42
Posts: 1,244
dljeffery is on a distinguished road
Default

Quote:
Originally Posted by micharadi View Post
But I've got zero knowledge in how to work with SQLite Database. I will start looking for good tutorials on the internet. If you know some good materials, please do tell me.
Actually, in your original post, you said you were already planning on this being a Core Data app (although then you asked about using XML as your data store, which I believe is still not possible on iOS if you are using Core Data, so I'm a bit confused).

If you are using Core Data, you can completely ignore the fact that you are using SQLite as your data store. All you do is interact with the Core Data API.

Well, actually, it IS still good to be somewhat familiar with SQLite. But only for debugging purposes. Don't ever write code in your app to deal directly with your SQLite database if Core Data is managing it.
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Old 11-10-2011, 02:29 AM   #5 (permalink)
Registered Member
 
Join Date: Sep 2011
Location: Barcelona
Posts: 5
micharadi is on a distinguished road
Default

Quote:
Originally Posted by dljeffery View Post
Actually, in your original post, you said you were already planning on this being a Core Data app (although then you asked about using XML as your data store, which I believe is still not possible on iOS if you are using Core Data, so I'm a bit confused).
I think it is. I have seen an example which can implement this. I've learned it from a Swedish blogger who provided a sample code for this idea. Here is the code sample:
http://blog.sallarp.com/wp-content/u...reDataTest.zip

Following this technique is not suited for my previous mentioned idea, is it?

Quote:
Originally Posted by dljeffery View Post
If you are using Core Data, you can completely ignore the fact that you are using SQLite as your data store. All you do is interact with the Core Data API.

Well, actually, it IS still good to be somewhat familiar with SQLite. But only for debugging purposes. Don't ever write code in your app to deal directly with your SQLite database if Core Data is managing it.
A couple of reasons why I am not able to figure out the best approach to implement my idea. I'm new, I don't wanna learn everything at once and I prefer to learn what I need for specific purposes: like this kinda app. When I started learning Obj-C and XCode, I thought doing it manually by writing thousands of UIViewControllers and too much use of IB, imagine? So I'm lost.
micharadi is offline   Reply With Quote
Old 11-17-2011, 02:08 AM   #6 (permalink)
Registered Member
 
Join Date: Sep 2011
Location: Barcelona
Posts: 5
micharadi is on a distinguished road
Default

Anyone can help me with this problem. I am still not able to solve it and I have some problem of how to use the appdelegate. I am trying to create a drill-down table from an xml file in app combining tab bar and navigations. As previously mentioned, I'm following this example.

My question is: How can I manage the classes (using the example) to obtain such a complex app scheme?

I would happily welcome any help at all!
micharadi is offline   Reply With Quote
Reply

Bookmarks

Tags
coredata, navigation, tabbar, xml file

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: 400
17 members and 383 guests
7twenty7, Alex-alex, Apptronics RBC, baja_yu, dre, FrankWeller, gwelmarten, ipodphone, jeroenkeij, jleannex55, matador1978, n00b, pbart, reficul, Retouchable, Sami Gh, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,125
Posts: 402,910
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

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