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?
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.
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.
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.
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.
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
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.
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?