2

Im reading in this book "Wrox Beginning IOS 4 Application Development" to try n figure out how to be able to save user data using sqlite3.

In this exercise it is telling me to start a new "view based Application". I do that and then it says to "Right Click" the "Frameworks" folder and add the "libsqlite3.dylib" Library to it.

Well i cant figure out how to add that library. I downloaded the source code for this book thinkin it might be in there and its not. So im assuming it is something built in to xcode but i cant figure out how to add this thing.

Can anyone lead me in the right direction so i can try and get started on this chapter?

Shaun Hornsby
  • 115
  • 1
  • 11

2 Answers2

3

While you can certainly use SQLite directly it's strongly recommended that you use CoreData instead these days - which is backed by SQLite but provides an Objective-C API. There are plenty of tutorials and articles and videos on how to use CoreData (check iTunes U - Stanford CS193P for an excellent introduction to CoreData). Also when you create a new CoreData application it automatically includes everything you need.

Setanta
  • 56
  • 4
  • Thanks Setanta I will deffinatly give that a shot. Now if i was to Create a new CoreData app that includes everything from the start. would i be able to Import everything i have already done on the app i am working on or would i have to rebuild it all? – Shaun Hornsby Apr 06 '11 at 21:54
  • While CoreData is nice, there's nothing wrong with using SQLite directly. I for one find that in certain scenarios it's actually easier to use SQLite. – DarkDust Apr 07 '11 at 06:22
  • 1
    @DarkDust: Agreed on both counts - especially when you have to access pre-existing SQLite databases - but for general use CoreData is Apple's recommended way to go and if you're trying to learn the best way to store user data - that's the way I'd go. – Setanta Apr 07 '11 at 09:20
  • 1
    @Shaun: Having said the above - if you already have a lot of code written as you work through the book you're probably better off going with SQLite directly to keep things straight - then maybe when you have a good handle on things, go back and convert it to use CoreData as an exercise. Much of what you do directly in SQLite will translate across and it's useful to understand the underlying architecture of CoreData. – Setanta Apr 07 '11 at 09:24
  • thanks i will keep both options in mind. I may actually do 2 different apps. 1 with core data and one using SQlite so i can try and get a handle on both. – Shaun Hornsby Apr 07 '11 at 10:10
2

See my answer to this related question on how to do this (see the first Edit; the question was about adding libresolv but the steps are the same).

Community
  • 1
  • 1
DarkDust
  • 90,870
  • 19
  • 190
  • 224