0
我有四個視圖。核心數據在切換視圖時使屬性爲NULL
查看1,顯示帶添加按鈕的表格視圖。 (添加按鈕不可見,這是上面的屏幕截圖邊界)
視圖2(呈現時添加按鈕被按下)允許用戶關於他們想添加表視圖單元輸入的數據。 按下save
按鈕後,新單元格將添加到視圖中。
查看3如果用戶想編輯的單元格,他們只需輕按細胞。該視圖只允許用戶編輯已經在表格中的單元格。
但是,當我簡單地把圖4中圖1(表視圖)和圖3(小區編輯器視圖)之間,這些屬性/標籤顯示null
其中用戶輸入應該被顯示。但是當我從視圖1和視圖3之間移除視圖4時,該應用程序再次完美。有什麼理由?
我只是通過切換視圖:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
View3 * three = (View3 *) [storyboard instantiateViewControllerWithIdentifier:@"view3VC"];
View4 * four = (View4 *) [storyboard instantiateViewControllerWithIdentifier:@"view4VC"];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
three.managedObjectContext = self.context;
MyEntityClass *entity = [self.tableArray objectAtIndex:indexPath.row];
three.3entity = entity;
[self presentViewController:four animated:YES completion:nil];
}
你沒有提到什麼是對於 – mineschan
的觀點4這個觀點並不完全是一個完成的產品。我只想解決這個問題,因爲我最終需要將第四個視圖添加到應用程序中!所以,我只是在視圖上扔了一個按鈕來展示問題! –