I have been following Apple's Start Developing iOS Apps Today guide and have run into a problem. I'm not a newbie developer but I am new to iOS development and I can't see why I'm going wrong.
I have a file called STRAddTodoViewController.h which contains the following
#import <UIKit/UIKit.h>
#import "STRTodo.h"
@interface STRAddTodoViewController : UIViewController
@property STRTodo *todoItem;
@end
And in my STRTodosViewController.m I have:
- (IBAction)unwindToList:(UIStoryboardSegue *)segue {
STRAddTodoViewController *addTodo = [segue sourceViewController];
STRTodo *item = addTodo.todoItem;
if (item != nil) {
[self.todos addObject:item];
[self.tableView reloadData];
}
}
And I'm getting an error of:
Property 'todoItem' not found on object of type 'STRAddTodoViewController *'
For some reason, my public variable in STRAddTodoViewController isn't getting picked up in my other controller and I can't for the life of me figure out why. Any clues?
EDIT: Massive apologies everyone, seems like I had two copies of STRAddTodoViewController in my project and it was reading the old one when it was building. Such a simple mistake and I feel like a massive idiot now, but thanks to everyone who helped me out.