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, 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.

Curt
  #2 (permalink)  
Old August 5th, 2011, 03: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
Default

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

ipadhelper@me.com

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

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

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 01:10 PM
Chapter 18 code compile problem warlock7 BOOK: Ivor Horton's Beginning Visual C++ 2005 8 January 3rd, 2008 09:04 AM
Chapter 18 code won't compile warlock7 Visual C++ 2005 0 January 18th, 2007 03:10 PM
Cant compile or build on chapter 3 stzd8 ASP.NET 1.x and 2.0 Application Design 4 October 30th, 2006 02:01 PM
C# compile biran Visual Studio 2005 1 July 15th, 2005 01:36 PM



All times are GMT -4. The time now is 04:21 AM.


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