Question

The FMDB page just offers the cvs checkout. Maybe someone out there wrote a good tutorial on how to use FMDB with sqlite3 on the iphone?

Was it helpful?

Solution

The source is the documentation, apparently.

The question, though, is why aren't you using Core Data?

Gus effectively compiled FMDB for the iPhone because Core Data wasn't available. Now that it is (as of 3.0), the need for FMDB is diminished.


Obviously -- if you need code portability, then the direct sqlite APIs are likely the way to go.

If you need data portability, then a wrapper like FMDB is probably the right answer.

If your portability is achieved through fully native apps with a client/server data flow architecture (which will offer the best per-device user experience, though at a potentially greater development cost), then Core Data is typically the best answer on iOS.

OTHER TIPS

FWIW I have found CoreData to be buggy and unreliable, especially WRT its automatic model upgrading. I'm switching back to using raw SQLite and FMDB.

Check out this tutorial - I found it absolutely brilliant. Now using storyboards and ARC (automatic reference counting) myself, so had to modify the navigation parts a bit and skip the dealloc code, but if you are comfortable with xcode and sort of know what's going on, this is perfect. Nice explanations along the way, and no farting around: http://www.youtube.com/watch?v=2Ojr7DZLghk&feature=channel&list=UL

I downloaded the latest FMDB files from their source - instead of using his. The latest files are updated for arc, and I had no issues. Get them here: https://github.com/ccgus/fmdb

The xcode project in the svn repository has a fmdb.m file in it with plenty of usage examples to get you started.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top