small medium large xlarge

Back to: All Forums  Core Data
30 Oct 2008, 19:49
Brad Gibbs (7 posts)

I’m getting an error for the following code on page 20:

id recipe = [[recipeArrayController selectedObjects] lastObject];

saying that recipeArrayController is undeclared. This is sensible, since it hasn’t been declared. Where should it be declared?

Also, the action needs to be declared in the header file before IB will pick up on it:

  • (IBAction)addImage:(id)sender;

This isn’t explicitly mentioned in the text.

Finally, a private method to get the application support folder is added to the code, but not mentioned in the text:

@interface AppDelegate()

  • (NSString*)applicationSupportFolder;


08 Nov 2008, 17:30
Marcus S. Zarra (284 posts)


Thanks for catching the lack of clarity in the header. Those errors will be cleaned up in the next beta.

As for the -applicationSupportFolder, that method is actually included in the Core Data template.

10 Nov 2008, 21:05
Michael Sherman (2 posts)

I’m still missing where and how to declare the recipeArrayController.

10 Nov 2008, 23:37
Ashley Mills (3 posts)

You just need to add

@IBOutlet NSArrayController *recipeArrayController;@

to Grokking_Recipes_AppDelegate’s @interface , and then hook it up in Interface Builder.

12 Nov 2008, 05:44
Marcus S. Zarra (284 posts)

I would suggest reviewing the source code examples that can be downloaded for the book as the header is fully realized there. In addition the next release of the beta will have this oversight corrected.

You must be logged in to comment