Invalid selector sent to instance
I am creating a applications for teachers that will store Courses and students as well as keep track of grades. Right now it is set up in a data model that stores the courses in an array. The courses are objects that include an array of students and assignments. I have a tableview of all the courses that transitions to a tableview of students. In the courses detail view I have a tableview cell that transitions to a third table view for the assignments. My problem is occurring here. When I try to add an assignment to the tableview I am getting the error:  'NSInvalidArgumentException', reason: '-[__NSArrayI addObject:]: unrecognized selector sent to instance 0x6b38620'..

Here is some code that I believe may contain the problem.


Course detail view controller:


    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
    if ([segue.identifier isEqualToString:@"AssignmentTable"]) {

		AssignmentViewController *controller = segue.destinationViewController;
		controller.checklist = checklistToEdit;
    
    }


    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        if(indexPath.row == 2)
        {
        [self performSegueWithIdentifier:@"AssignmentTable" sender:checklistToEdit];


        }
    }


Assignment View controller:


    - (void)editAssignmentViewController:(EditAssignmentViewController *)controller     didFinishAddingItem:(Assignment *)item
    {
	int newRowIndex = [self.checklist.assignments count];
    
    [self.checklist.assignments addObject:item];
    
	NSIndexPath *indexPath = [NSIndexPath indexPathForRow:newRowIndex inSection:0];
	NSArray *indexPaths = [NSArray arrayWithObject:indexPath];
	[self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationAutomatic];
    

	[self dismissViewControllerAnimated:YES completion:nil];
    }


Assignment Detail View Controller:

    - (IBAction)done
    {
    if (assnToEdit == nil) {
		Assignment *item = [[Assignment alloc] init];
        item.texta = self.textFielda.text;
        
        [self.delegate editAssignmentViewController:self didFinishAddingItem:item];
    
        
	} else {
        self.assnToEdit.texta = self.textFielda.text;
        
        [self.delegate editAssignmentViewControllerDidCancel:self];	
    }

    }
Invalid selector sent to instance
===

I am creating a applications for teachers that will store Courses and students as well as keep track of grades. Right now it is set up in a data model that stores the courses in an array. The courses are objects that include an array of students and assignments. I have a tableview of all the courses that transitions to a tableview of students. In the courses detail view I have a tableview cell that transitions to a third table view for the assignments. My problem is occurring here. When I try to add an assignment to the tableview I am getting the error:  'NSInvalidArgumentException', reason: '-[__NSArrayI addObject:]: unrecognized selector sent to instance 0x6b38620'..

Here is some code that I believe may contain the problem.


Course detail view controller:


    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
    if ([segue.identifier isEqualToString:@"AssignmentTable"]) {

		AssignmentViewController *controller = segue.destinationViewController;
		controller.checklist = checklistToEdit;
    
    }


    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        if(indexPath.row == 2)
        {
        [self performSegueWithIdentifier:@"AssignmentTable" sender:checklistToEdit];


        }
    }


Assignment View controller:


    - (void)editAssignmentViewController:(EditAssignmentViewController *)controller     didFinishAddingItem:(Assignment *)item
    {
	int newRowIndex = [self.checklist.assignments count];
    
    [self.checklist.assignments addObject:item];
    
	NSIndexPath *indexPath = [NSIndexPath indexPathForRow:newRowIndex inSection:0];
	NSArray *indexPaths = [NSArray arrayWithObject:indexPath];
	[self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationAutomatic];
    

	[self dismissViewControllerAnimated:YES completion:nil];
    }


Assignment Detail View Controller:

    - (IBAction)done
    {
    if (assnToEdit == nil) {
		Assignment *item = [[Assignment alloc] init];
        item.texta = self.textFielda.text;
        
        [self.delegate editAssignmentViewController:self didFinishAddingItem:item];
    
        
	} else {
        self.assnToEdit.texta = self.textFielda.text;
        
        [self.delegate editAssignmentViewControllerDidCancel:self];	
    }

    }