Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional iPhone and iPad Database Application Programming
This is the forum to discuss the Wrox book Professional iPhone and iPad Database Application Programming by Patrick Alessi; ISBN: 978-0-470-63617-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional iPhone and iPad Database Application Programming section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old August 5th, 2011, 02:18 PM
Registered User
Join Date: Aug 2011
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 5 Example Won't Compile

I running the latest Xcode on Lion. The example code in Chapter 5 won't compile as is. When I make what appear to be appropriate corrections, it compiles but crashes.

On page 141 in fetchedResultsController I changed inManagedObjectContext:managedObjectContext to inManagedObjectContext:self.managedObjectContext

On page 142 in tableView... I changed NSManagedObject *managedOject = [fetchedResultsConroller objectAtIndexPath:indexPath]; to NSManagedObject *managedOject = [self.fetchedResultsConroller objectAtIndexPath:indexPath];

I also tried __fetchedResultsConroller, which is what Xcode suggested.

Once I got it to compile, it dies with "executeFetchRequest:error: A fetch request must have an entity".

I put a break point on [fetchRequest setEntity:entity]; on page 141. At that point entity is a zero pointer. I'm guessing the initialization of the pointer in the previous line didn't work. That's where I changed managedObjectContext to self.managedObjectContext

I also checked the online code to find it is the same. At least the problem let's me practice my debugging skills.

  #2 (permalink)  
Old August 5th, 2011, 04:32 PM
Friend of Wrox
Points: 1,671, Level: 16
Points: 1,671, Level: 16 Points: 1,671, Level: 16 Points: 1,671, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts

Post the code where you have made the changes, and/or send your project to


and I should be able to point your in the right direction.

The Following User Says Thank You to thepianoguy For This Useful Post:
gcortes (August 5th, 2011)
  #3 (permalink)  
Old August 5th, 2011, 07:11 PM
Registered User
Join Date: Aug 2011
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts

I fixed the execution problem. I didn't name the entity correctly in the model. It still may be the case that the example code needs to be corrected to compile cleanly.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 9 compile-time error eiviery BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 0 November 4th, 2009 02:10 PM
Chapter 18 code compile problem warlock7 BOOK: Ivor Horton's Beginning Visual C++ 2005 8 January 3rd, 2008 10:04 AM
Chapter 18 code won't compile warlock7 Visual C++ 2005 0 January 18th, 2007 04:10 PM
Cant compile or build on chapter 3 stzd8 ASP.NET 1.x and 2.0 Application Design 4 October 30th, 2006 03:01 PM
C# compile biran Visual Studio 2005 1 July 15th, 2005 02:36 PM

All times are GMT -4. The time now is 04:01 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.