views:

41

answers:

2

I'm trying to find a solution to what I think has to be a simple problem. I'm using coredata to maintain a list of bookmarks in my app. there are only three fields being stored, bid, order and title.

in some cases I want to update an existing record. currently I'm using a predicate to search for a particular bid. the problem I'm having is accessing the record as an object so it can be updated and resaved.

any help? also, are there any guidelines for how much data should be stored in a plist or user default?

a user can potentially have hundreds of bookmarks.

thanks,

howie

+1  A: 

Fetched results come back as a set. If there is only a single result, you could call anyObject on the set to obtain the actual managed object. Post some code if you want some detailed help.

Core Data is the right solution here, so don't resort to plists or user defaults.

Matt Long
+1  A: 

The fetched results are returned as an instance of NSSet. Get the object you want to change (either with anyObject or objectAtIndex: or you can loop through the whole set) and then change the property you want. Then just call the function "save:" on your managedObjectContext.

Conceited Code
forgive my ignorance, once I perform the fetch on the featchResultsController, how do I access the NSSet from the controller? I tried using fetchedObjects, but that is just an array.Thanks
Ward