p254: ItemDetailViewControllerDelegate Implementation..



this ItemDetailViewControllerDelegate Implementation… drives me nuts.

Goog thing is: It works!

in ItemsViewController.m gets called. so it can’t be that wrong. but as soon as i declare that i conform to ItemDetailViewControllerDelegate in ItemsViewController.h, the project will not build.

#import <Foundation/Foundation.h>
#import “ItemDetailViewController.h”

@interface ItemsViewController : UITableViewController <UITableViewDataSource, ItemDetailViewControllerDelegate>


this is the protocol implementation from ItemDetailViewController.h:

@class ItemDetailViewController;
@protocol ItemDetailViewControllerDelegate <NSObject>
-(void)itemDetailViewControllerWillDismiss:(ItemDetailViewController *)vc;

for full reference, find the non-compiling project here: dl.dropbox.com/u/9327964/Homepwner.zip

any ideas?

regards, tobias



In your ItemDetailViewController.h file you have #import “ItemsViewController.h”

but ItemsViewController references the ItemDetailViewControllerDelegate protocol which isn’t defined at that point. (You define it a few lines later)

so if you remove the #import ItemsViewController.h (or move it to after the protocol declaration) you should be ok.



Thanks, you are right. That fixed the problem. Man this stuff can get confusing :wink: