Re: Help with Core Data and an NSTableView
Re: Help with Core Data and an NSTableView
- Subject: Re: Help with Core Data and an NSTableView
- From: mmalcolm crawford <email@hidden>
- Date: Thu, 15 Dec 2005 08:38:50 -0800
On Dec 15, 2005, at 6:14 AM, Ryan Glover wrote:
I have been experimenting with Core Data and I have created a simple
application that allows the user to add file path references to a Core
Data entity. The TableView has a single column and lists the file
paths.
I then created an action and an outlet for the table view so that when
a user double clicks on the table it fires the action. I am able to
grab the index of the row clicked inside the subroutine for this
action.
My question is how do I associate that index with the corresponding
entry in core data? (in other words, how do i get the filePath from
the index). I have read about having a NSMutableArray named records
that tracks all of the data in the table but in all of the examples I
have seen Core Data isn't being used. Does Core Data create an
NSMutableArray for the TableView that I could tap into with my index?
It's not clear what you mean by "with the corresponding entry in core
data?" The array controller simply manages a collection of objects,
just as it would if you were not using Core Data. You can ask the
array controller for its 'selectedObjects', and from the objects in
that array ask for 'valueForKey:@"filePath"' or whatever.
See <
http://developer.apple.com/documentation/Cocoa/Conceptual/
CoreData/Articles/cdCreateMOs.html> and <
http://developer.apple.com/
documentation/Cocoa/Conceptual/CoreData/Articles/cdUsingMOs.html>.
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden