每當我退出這個xib並返回時,我都會得到重複的單元格。當再次加載vc/xib時,單元格翻倍
可以說我添加了兩種成分,大米和糖。如果我退出並返回,我的配料就會翻一番。每次加載此控制器時都會發生這種情況。
我認爲這是錯誤的代碼:
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:YES];
//fixed doubling up of ingredients by addingn else before the other if and corresponding bracket Nov 13 falcon
if (self.groceryList) {
self.arrIngredients = [((MealIdeaAppDelegate*)MI_SHARED_DELEGATE).dbCommunicator getMyGroceryListIngredients:self.groceryList.groceryListID];
NSLog(@"data %@ ",self.groceryList.groceryListID);
self.title = self.groceryList.groceryListName;
txtfListName.text = self.groceryList.groceryListName;
//Added else Nov 13 falcon
}else if ([self.groceryList.groceryListName caseInsensitiveCompare:kDeafaultGroceryListName] == 0) {
[txtfListName setUserInteractionEnabled:NO];
}
[tblvGroceryListDetail reloadData];
}
add image plz。 ??? – Omarj