Hi, I wish to edit an existing record in core data. At the moment, I have this code, but it creates a new record (and inserts the correct data into the correct column):
NSManagedObjectContext * context = [[NSApp delegate] managedObjectContext];
NSManagedObject * instrument = nil;
instrument = [NSEntityDescription insertNewObjectForEntityForName: @"Instrument"
inManagedObjectContext: context];
[instrument setValue:[NSNumber numberWithInt:quantityInStockInstruments]
forKey: @"quantity"];
The result will look like this:
Instrument | Value | Quantity
Violin | £25 | 9
| | 8 <<< This is the new record that is created, instead of setting the
quantity of violin from '9' to '8'
I want the program to edit the quantity column of the currently highlighted row, (which in this case is the 'violin' row. How would I do this?
Thanks, Michael