RLMRealm을 사용하는 쇼핑 목록 응용 프로그램에서 작업하고 있습니다. 쇼핑 할 수있는 항목의 이름을 나타내는 Item 객체가 있습니다. 또한 RLMArray 항목을 보유하고있는 ShoppingList도 있습니다. 항목을 제거하면 존재하는 각 배열에서 해당 항목을 쉽게 제거 할 수 있습니까? RLMRealm, 개체를 제거 할 때 RLMArray에서 참조에서 제거하는 방법
나는이 시작 : 어느 작동하지// Look for this item in shoppingList.list and remove also
for shoppingList in ShoppingList.allObjects() {
for i in 0..<(shoppingList as ShoppingList).list.count {
if ((shoppingList as ShoppingList).list[i] as ShoppingItem).item == item {
(shoppingList as ShoppingList).list.removeObjectAtIndex(i)
}
}
}
. 그것은 어떤 오류도 던지지 않으며, 그냥 빈 항목을 남기는 것 같습니다.