Do you know if there is a simple database framework that is free to use in iPhone 开发者_StackOverflowdevelopment?
I've tried to get my head around Apple's framework SQLite3-framework, but it is just too complicated. Why can't it just be like PHP and databases …
So basically, what I want is a framework that is simple to use and can handle databases.
Thank you.
Core Data is Apple's method to persist objects on the iPhone. This is also the most common method for storing data when developing for OS X and future Apple technologies, so it's worth spending the time to learn. The Apple Docs (linked above) are the best place to learn about this since they don't get outdated easily. Additional tutorials can be found through your favorite search engine.
In addition to making persistence very easy to do, it offers the following benefits:
- Only store objects in memory that you need, to save memory usage
- Migration and versioning support
- Graphical-based schema editor in Xcode
- Automatic support for undo/redo
Try FMDB. It's a neat wrapper around the sqlite c API.
http://gusmueller.com/blog/archives/2008/03/fmdb_for_iphone.html
There's also PLDatabase.
A SQL database access library for Objective-C, initially focused on SQLite as an application database. The library supports both Mac OS X and iPhone development.
Google toolbox for Mac http://code.google.com/p/google-toolbox-for-mac/ also includes a nice little sqlite wrapper, in Foundation/GTMSQLite.h
. It isn't included in the provided iphone .xcodeproj but it does compile if you add it and its (minor) dependencies to an iphone project. Two classes: a db handle, and a prepared statement/resultset, with the expected methods on each.
精彩评论