好的,所以我有一个修改另一个属性的Viewcontroller,它返回:
'NSInvalidArgumentException',原因:'+ entityForName:nil不是合法的NSManagedObjectContext参数,用于搜索实体名称'Event''
这是我用来修改另一个的ViewController。
-(IBAction)switch:(UISwitch *)sender{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:
@"MainStorybo
ard_iPhone" bundle:[NSBundle mainBundle]];
MasterViewController *destViewController = [storyboard instantiateViewControllerWithIdentifier:@"master"];
static NSString *CellIdentifier = @"ElementCell";
UITableViewCell *cell = [destViewController.tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (color == @"Black") {
cell.textLabel.textColor = [UIColor whiteColor];
destViewController.tableView.backgroundColor = [UIColor blackColor];
destViewController.tableView.separatorColor = [UIColor whiteColor];
}else if(color == @"White"){
destViewController.tableView.backgroundColor = [UIColor whiteColor];
destViewController.tableView.separatorColor = [UIColor blackColor];
cell.textLabel.textColor = [UIColor blackColor];
}
}