Hello all,
not sure if any of you have ever coded in C++,C#,Foxpro etc. but text fields there has this property called “Control Source”. That lets you specify what field the text box should display. Example the control source of your age field will be student.age (where student is the name of the table).
Im just wondering if something similar can be done in Xcode and is it covered in the nerd ranch book 2nd edition
Of course; data from any source can be displayed. XML data, JSON data, data from a web service, data from a database — whatever. I must have misunderstood the original question. It sounded like the goal was to display data from a database without writing any Objective C code. (And again, this is possible with Mac programming, just not with iOS.)
The 2nd edition does indeed cover Core Data to pull data from an SQLite database (chapter 17), but be forewarned it’s not for the faint of heart. For my little brain it’s probably the most difficult part of the book (but it’s something I need to become comfortable with).
Core Data is covered in the 1st edition as well (chapter 27). The 1st edition also has an interesting chapter on getting down and dirty with SQLite directly (chapter 26) so you can get a feel for everything that’s involved. It’s good to understand this but you’ll probably actually use it only in other development environments (which I suspect is part of the reason that chapter was dropped from the 2nd edition).
Remember the fun you had way back in chapter 6 with drawing, where it was very un-Cocoa-like (because, uh, it didn’t use Cocoa)? SQLite is like that; not pretty. So developers who need access at this level may use something like fmdb as an Objective C wrapper around SQLite. It’s still good to understand what’s really happening behind the scenes; you just probably won’t use it that way.
(I still recommend the 2nd edition, of course. With the updated code and techniques [like “blocks” — a fascinating construct] and greater emphasis on the iPad, plus focus on Xcode 4 [so pretty much every screenshot had to be updated] which otherwise seemed so obtuse to me, I’ve found it very useful.)