Re: Core Data adding new instance - creating relationship to existing instance

2008-09-20 Thread Amy Heavey
Thank You, and I am very sorry for being so dim, I'm working on an app that accessing an existing file that Definitely has the Categories, but I'd forgotten that I'd been working on an empty file to make it easier to see changes I was making! Many Thanks Amy On 19 Sep 2008, at 19:23, Ja

Re: Core Data adding new instance - creating relationship to existing instance

2008-09-19 Thread Jamie Hardt
Hi- Your fetch request isn't finding any Categories, and the array returning from executeFetchRequest is empty. Before doing the setValue:forKey:, you should test the returned array from executeFetchRequest to make sure it contains >0 categories, and handle the situation appropriately if

Core Data adding new instance - creating relationship to existing instance

2008-09-19 Thread Amy Heavey
I'm trying to add new instances of some entities, I've got it adding new objects, and I can create new relationships to new related objects, but I can't work out how to connect a new instance to an existing instance of an entity, eg I have items with relationship to upcs and categories. I