O'Reilly Forums: Chapter 8-Page 416 - O'Reilly Forums

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Chapter 8-Page 416 Where is the Datasource???

#1 User is offline   furrybaer 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 22-July 11

Posted 01 August 2011 - 09:33 AM

I am new to Objective C, but I am learning fast. I am getting through this book pretty well, but I am stumbling on page 416 where it says to "make sure the table view in the Fugitive List has its datasource as teh FugitiveListViewController". Since we did not include the Xib file with the ViewController, I"m not sure where to set the datasource. Could I get some more detail/clarification on where this is? I'm sure it's probably obvious, but I don't see it in Xcode 4.

Thanks again.

Mark
0

#2 User is offline   FrostK 

  • New Member
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 08-August 11

Posted 08 August 2011 - 09:04 AM

Mark

I agree with your post and am stuck on the same cryptic set of instructions regarding making this linkage so that the table view in the Fugitive List will properly receive the database feed from FugitiveListViewController. I plan to build it one more time from the beginning to see if I somehow missed something and will post it if I find a solution.

Ken
0

#3 User is offline   dexon 

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 09-August 11

Posted 09 August 2011 - 05:55 PM

I'm having the same issue...

This post has been edited by dexon: 09 August 2011 - 06:39 PM

0

#4 User is offline   dexon 

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 09-August 11

Posted 09 August 2011 - 08:21 PM

View Postdexon, on 09 August 2011 - 05:55 PM, said:

I'm having the same issue...



Hmmm. I notice in the code that the authors created, that the .xib files are indeed included in their build, which seems to indicate that the checkbox should be checked for the .xib file (pp.380 2nd Ed.)
0

#5 User is offline   FrostK 

  • New Member
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 08-August 11

Posted 10 August 2011 - 06:05 AM

Good catch, although I'm even more confused now. The supplied code does have both FugitiveListViewController.xib and CapturedListViewController.xib although the text clearly states NOT to include .xib when creating the class. Also, since the two sets of ListViewControllers are created from a single UITableViewController instance, how would you end up with two .xib files? Seems like you would have to create two separate UITableViewControllers initially?

I need to play with this and see if I can figure out what they've done.

Ken
0

#6 User is offline   dexon 

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 09-August 11

Posted 10 August 2011 - 06:30 AM

Yes, on pp.386 you create the Captured view by repeating the steps for Fugitive view. Again, you need to check the box to create a .xib file.

I'm assuming the the latest build of XCode didn't support some of the old functions used in the book, and the code has been updated. It would have been great if they also updated the errata.
0

#7 User is offline   FrostK 

  • New Member
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 08-August 11

Posted 10 August 2011 - 07:59 AM

Right, I had forgotten that I had done that step twice to create sets of UITableViewControllers for Fugitives and Captured. I'm going to redo that portion of the build and create the .xib files and see if that is successful.

Your point regarding the switch between versions of Xcode is a good one. I began the book using 3.x and upgraded after running into difficulties translating between that version and the 4.x that the text uses. Combine that with the fact that they added iPad development in this version has left some errors and inconsistencies to work through.

I'll post again when I have something to report.
0

#8 User is offline   FrostK 

  • New Member
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 08-August 11

Posted 10 August 2011 - 05:13 PM

A quick update:

I rebuilt the app adding the .xib files but still didin't find a solution.

I did get in contact with one of the authors (Tracey) and she will get back to me, probably tomorrow, with the answer. One of us will update this post with the solution.

Ken
0

#9 User is offline   dexon 

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 09-August 11

Posted 10 August 2011 - 05:51 PM

View PostFrostK, on 10 August 2011 - 05:13 PM, said:

A quick update:

I rebuilt the app adding the .xib files but still didin't find a solution.

I did get in contact with one of the authors (Tracey) and she will get back to me, probably tomorrow, with the answer. One of us will update this post with the solution.

Ken


Thanks, Ken. I look forward to seeing the solution to this!
0

#10 User is offline   e2tt 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 11-August 11

Posted 11 August 2011 - 01:19 AM

View Postfurrybaer, on 01 August 2011 - 09:33 AM, said:

I am new to Objective C, but I am learning fast. I am getting through this book pretty well, but I am stumbling on page 416 where it says to "make sure the table view in the Fugitive List has its datasource as teh FugitiveListViewController". Since we did not include the Xib file with the ViewController, I"m not sure where to set the datasource. Could I get some more detail/clarification on where this is? I'm sure it's probably obvious, but I don't see it in Xcode 4.

Thanks again.

Mark


Hi all,

I got stuck on this issue too, and then I found the solution.

At the Interface Builder, you have to drag the "Table View" object to your xib file (under the "Fugitive List View Controller - Fugitives" object.

And then right click on it, and at the "datasource" outlet, please drag the link to the "Fugitive List View Controller - Fugitives" object. That is all.

Now, please try to "Build and Run", and you will get it to work.

Hope this help, and please accept my apology on my English.

Have a good day,
e2tt

This post has been edited by e2tt: 11 August 2011 - 01:23 AM

0

#11 User is offline   FrostK 

  • New Member
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 08-August 11

Posted 11 August 2011 - 09:31 AM

e2tt

Your solution worked for me too. Now it seems obvious that a TableView needed to be added since originally there was only a TableViewController. That step is missing from the instructions but I should have realized what was going on. Unfortunately, none of the illustrations show the TableView object in the Interface Builder either, or I might have caught it earlier.

Thanks,

Ken
0

#12 User is offline   Kenneth P 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 11-August 11

Posted 12 August 2011 - 10:10 AM

View Postfurrybaer, on 01 August 2011 - 09:33 AM, said:

I am new to Objective C, but I am learning fast. I am getting through this book pretty well, but I am stumbling on page 416 where it says to "make sure the table view in the Fugitive List has its datasource as teh FugitiveListViewController". Since we did not include the Xib file with the ViewController, I"m not sure where to set the datasource. Could I get some more detail/clarification on where this is? I'm sure it's probably obvious, but I don't see it in Xcode 4.

Thanks again.

Mark


The supplied code do have Fugitives and Captured xib files but they are NOT actually required. The program still work. Also, I used Xcode 4.1 on Lion, the data model created by Xcode won't work with the sqlite db, I must replace it with one supplied from HeadFirst/GitHub
0

#13 User is offline   Cruzor 

  • New Member
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 18-October 11

Posted 18 October 2011 - 09:01 PM

I'm having trouble with P. 416 also. I read e2tt's solution but adding the TableViewController (from the library) didn't work for me as the controller would not go under ViewController it replaced the ViewController.

How do you fix this or is this supposed to be the solution?
0

#14 User is offline   vinaykrypton 

  • Active Member
  • PipPip
  • Group: Members
  • Posts: 11
  • Joined: 16-September 11

Posted 21 October 2011 - 01:55 AM

Hiii ! thank,s for sharing this information.Thanks Vinay from Outsource Blackberry Development
Team, KryptonSoft, India
http://www.kryptonsoft.com/outsourcing/iphone-application-development-india
outsource iphone development
Team, KryptonSoft, India
0

#15 User is offline   drew_35144 

  • Active Member
  • PipPip
  • Group: Members
  • Posts: 18
  • Joined: 28-October 11

Posted 05 December 2011 - 08:01 PM

I bought this book recently, with enough time for corrections to be more readily available. The instructions on page380 clearly state NOT to check the XIB option, so clearly something is amiss.

General feedback: while i appreciated the format of the book when i started, the forced linear nature of the back-tracing is frustrating. It is almost like listening to an audio presentation on an old-fashioned tape recording and needing to bop around looking for info. When we need to go back and check for something, it just becomes a very time-consuming task..

Don't the authors monitor questions here?
0

#16 User is offline   drew_35144 

  • Active Member
  • PipPip
  • Group: Members
  • Posts: 18
  • Joined: 28-October 11

Posted 07 December 2011 - 05:51 PM

looks like we are on our own here:* i dropped a TableView onto my Fugitive view, then wired it up so that both the datasource and the delegate were hooked to the Fugitive ListView Controller. works fine.
Not experienced enough yet to realize why we can't simply create ONE view for both buttons (Fugitive & Captured) and simply filter the call to the db properly. Seems simple enough.
0

#17 User is offline   SilithCrowe 

  • New Member
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 13-January 12
  • Gender:Male
  • Location:Vienna, VA (near DC)
  • Interests:Computer Science, Mobile Development (Android, iOS), Movies, Listening to Music, Drumming, Snowboarding, Rock Climbing, Video Games

Posted 17 January 2012 - 01:29 PM

Came here to say two things (I'm using Xcode 4.1 on Lion):

1. I never had to wire up any Table Views in the main nib file, nor did I have to create nib files for the Fugitive and Captured view controllers. I simply ignored that tiny "Do this!" at the bottom of pg. 416 (2nd Ed.) and it all worked out just fine. Very strange. Please do note that at this point in the book's narrative, you're not *supposed* to see anything in the table view. Skip ahead to pg. 420 and you'll see that there's more to do before things start working properly.

2. Kenneth P was absolutely right about needing the model from github. If you're crashing because the model that's loading the database doesn't match the model that created it, don't think twice about replacing your .xcdatamodeld file. I'm sure that in the real world you wouldn't be provided a database without also being provided this file; or even, you'd probably just be creating the database yourself. Here's a link to HF's code for chapter 8: https://github.com/d...ree/master/ch08
0

#18 User is offline   Boswell David 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 09-February 12

Posted 09 February 2012 - 05:59 PM

I have tried all these ideas and am still having this error

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSKeyedUnarchiver initForReadingWithData:]: incomprehensible archive (0x53, 0x51, 0x4c, 0x69, 0x74, 0x65, 0x20, 0x66)'

I have not change the .xcdatamodeld file because I can't figure out how to download it from the github link.

can you help?
0

#19 User is offline   Boswell David 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 09-February 12

Posted 10 February 2012 - 06:47 AM

:lol: Never mind I found the problem. I had changed the Extension inadvertently.

FYI: I did have to drag a table in and connect it.
0

#20 User is offline   Boswell David 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 09-February 12

Posted 10 February 2012 - 11:39 AM

not that anyone is still active on this thread, but if you are looking. That whole table thing messes you up when you connect the detail view. So no additional table view.
0

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users