Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iJustinCabral

macrumors member
Original poster
Jul 8, 2012
58
0
Code:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"AddItem"]) {
UINavigationController *navigationController = segue.destinationViewController;
AddItemViewController *controller = (AddItemViewController *)navigationController.topViewController;
[U]controller.delegate = self;[/U]
}
}
I'm trying to add this piece of code in, but I get an error saying:

"Property 'delegate' cannot be found in forward class object 'AddItemViewController*'


Is there a step that I might of over looked, or something that has to be done on the story board? I've tried to backtrack and trouble shoot but I cant get it,
If anyone can help, I'd appreciate it.
 
Does your view controller conform to the delegate protocol? You would have to set this in your .h file.
 
Did you #import the header for AddItemViewController?

What happens if you try

[controller setDelegate:self];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.