Wrox Programmer Forums
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 5th, 2011, 01: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.

Old August 5th, 2011, 03:32 PM
Friend of Wrox
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

[email protected]

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)
Old August 5th, 2011, 06: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.

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 01:36 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.