I have a SQLite database that I want my app to read and load into a UITableView then push to a Detail View.
I am using the FMDB wrapper framework (https://github.com/ccgus/fmdb). I'm confused as to how exactly to do this as I've never used SQLite in an iPhone app before.
Can anyone help get me started? What code do I need to add to I'm assuming viewDidLoad?
I think you should use CoreData framework provided in iPhone SDK. Its pretty simple to use and it manages most of the complex things for us. It provides a way to use Sqlite database as a persistent store for your application. You can just start with it from the documentation provided in iPhone SDK documentation under "Core Data Programming guide" section.
Related
I have an Android app I wrote that uses a sqllite database, now I am writing the same app for iPhone. How do I use the existing sqllite database from my android app in the iPhone version?
More specific questions:
Where do I place the actual sqllite database - What folder?
Can I just use iPhone sql statements to open and read the data?
Could I just use an xcode emulator until I move the iPhone app to an actual device?
If you're happy with using sql, you don't necessarily need to go through the CoreData pain barrier. Ray Wenderlich also has a good tutorial on using Sqlite directly in your app here:
Part 1 - SQLite 101 for iPhone Developers (Intro)
Part 2 - SQLite 101 for iPhone Developers (The actual coding with Sqlite)
His site is a great resource for experienced developers wanting a quick and practical guide to getting started with almost every aspect of iOS development imaginable.
Here you can find a tutorial about how to import a SQLite Databse to core data:
How To Preload and Import Existing Data
I'm writing a simple iOS App to manage Email address, maybe like Contacts. I don't know what is the best way to organize data in iOS and don't know which database that iOS and Xcode support. I just know that iOS supports XML & SQLite, are there other databases supported?
Which is the best database (XML, SQLite,...) for this app?
If you are going to add only email and contacts then my suggestion is you just use plist.
http://developer.apple.com/technologies/ios/data-management.html
You should try CoreData. Have a look here to see what's it about. It offers a great way to handle the things you said you want to achieve.
CoreData is good option. The persistence used by core data is abstracted away while you can still choose SQLite, XML, or in memory for the persistent store.
Could please share a simple program(or link) to understand core data in iPhone. The program should cover add & delete a entry in table view. Program without IB is preferable.
Thank you
Read the blog on CoreData from apple
Building a Sample Core Data Application
Read more
Cocoa Dev Central . Articles . Build a Core Data App
iPhone Core Data: Your First Steps
Core Data Tutorial: Getting Started
Have you read through the core data programming guide on the Apple Developer center? link
Take a look at the Stanford iPhone development course, in particular lecture 12
http://www.stanford.edu/class/cs193p/cgi-bin/drupal/downloads-2010-fall
Apple also have a lot of sample code in the developer program, including an excellent introduction to core data http://developer.apple.com/library/ios/#documentation/DataManagement/Conceptual/iPhoneCoreData01/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008305
Open Xcode
File -> New Project
iOS or Mac App, you choose
Select the App Type (Master-Detail, etc) again, you choose
Choose Next
Give it a name, company identifier
Check the box next to "Use CoreData"
Choose Next
Find a home on the file system for your new app (~/Documents will work just fine)
Choose Create
Open [Your App Name]AppDelegate.m and notice that Xcode wrote all the coredata scaffolding for you!
I was also looking for simple example regarding this but unfortunately could not found which tells me straight forward. Here is what I have prepared. It is very basic example iOS project, shows only save and retrieve data in SQLite using pure Core Data framework.
http://www.iosmobileapps.biz/examples/CoreDataEx.zip
Hope you will find this useful.
What is the best way to store data for the iPhone? I will be developing an iPhone app in Objective-C which will take data from end users. This data will need to be save and loaded at various points.
Essentially, what is the best combination of languages and frameworks to use in order to develop the above (i.e. should I be aware of any compatibility or like issues regarding the objective-c language)?
EDIT: Are there any particular reasons why to choose sqllite over core data?
Hey, the best way to store and manage data is Core Data framework, you can read about it in official docs.
Two of the most popular and reasonable solutions:
Apple's native solution: CoreData
sqlite3
I used sqlite3 for my applications. If you use mySQL then you'll be very comfortable to use sqlite3. However, people recommend CoreData due to its ease of use and iOS support.
I would also like to add my vote for the CoreData solution. I investigated all the options (CoreData, sqlite3 and plists) and CoreData seemed to be the right option for me.
I found a brilliant tutorial on it for iOS 5 here
i want to create login form using sqlite in iphone view based application please help me.give any idea about sqlite in iphone and any sqlite tutorial for iphone application development..
Hope this tutorial will help you.
very nice tutorial,
Just FYI, I recommend using Firefox extension to edit SQLite.
It is much faster in real life.
Thankz