Hi folks, I’ve got the Core Data project pretty much complete and working, but it looks like there’s at least one thing that it should be doing but isn’t.
I can set the count for an asset without problem, and when I return to the assets listing view, that count is reflected so I know it’s being saved in the Core Data stores. However, when I return to the count view for that same asset, the count number which I previously entered is not displayed in the TextField.
I’d like it to be displayed in the TextField, but I’m not quite sure how to pass it across from the Core Data store to the CountView. There is already a method which is setting this value upon the loading of the view:
NSString *prompt = [NSString stringWithFormat:@"%@: %@",
[numberField setText:[count stringValue]];
So you can see the numberField is supposed to get set to the count value. However, that count value isn’t actually getting set when the CountViewController is instantiated (tableView:didSelectRowAtIndexPath from AssetListViewController.m):
- (void) tableView(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)ip
countViewController = [[CountViewController alloc] init];
NSManagedObject *asset = [assetList objectAtIndex:[ip row]];
[[self navigationController] pushViewController:countViewController animated:YES];
So, how the heck do I dig the count value for that particular asset item out of the Core Data store so I can attach it to the CountViewController object and have it displayed? That’s my basic problem. I just don’t know how to grab the right data so I can include it with the object.