Posts

Post not yet marked as solved
3 Replies
401 Views
I have an ShoppingItem Entity(attributes: name, id, unit, qty, description) and another entity ShoppingList(attributes: listDate, listName) and a relationship property : items which is many-to-many relationship. The use case is : _The items that are selected by the user have to be updated to the list on the particular date. let myList = GroceryList(context: CoreDataManager.shared.viewContext)     myList.name = "One more List"     myList.madeOn = Date() 1.     myList.mutableSetValue(forKey: "groceryItems").add(selectedGroceryItems)     CoreDataManager.shared.save() selectedGroceryItems is of type struct ItemEntityViewModel {       let groceryItem: GroceryItem       var itemEntityid: NSManagedObjectID {     return groceryItem.objectID   }       var id: UUID {     return groceryItem.id ?? UUID()   }   var name: String {     return groceryItem.name ?? ""   }       var category: String {     return groceryItem.category ?? "Not available"   }       var unit: String? {     return groceryItem.unit ?? ""   }       var qty: Double? {     return Double(groceryItem.qty)   } } line 1 throws exception as follows: NSInvalidArgumentException', reason: -[Swift.__SwiftDeferredNSArray entity]: unrecognized selector sent to instance 0x600003f5e320' terminating with uncaught exception of type NSException
Posted
by urd-2020.
Last updated
.
Post not yet marked as solved
0 Replies
400 Views
Hi, I have downloaded the sample code for the Mapkit->Searching for Nearby Points of Interest. I wanted to know if there are guided project or Guides accompanied with the same. Thanks in advance.
Posted
by urd-2020.
Last updated
.