Bindings: Accessing Data in an NSArrayController
Bindings: Accessing Data in an NSArrayController
- Subject: Bindings: Accessing Data in an NSArrayController
- From: Kane Dijkman <email@hidden>
- Date: Fri, 12 Aug 2005 18:22:32 -0700
I am still struggling to get my head around bindings, so I apologize
if the answer to this question is totally obvious.
I created an NSTableView and, using bindings, added a bunch of
objects to the array that the NSArrayController uses. The bindings
were created in IB and the values are added programatically. This
works fine. I have buttons to add and remove items from the array
that also works fine.
But now I can't figure out how to reference the array to access the
values.
I have a basic list of string values that are pulled from a text file
and put into the array with this loop:
for(i=0; i<[listArray count]; i++)
{
[self appendToListEditorObjectArray:[listArray objectAtIndex:i]];
}
which calls this function:
- (void)appendToListEditorObjectArray:(NSString *)aSymbol
{
ListEditorObject * leo = [[ListEditorObject alloc] init];
[leo setSymbol:aSymbol];
[[self mutableArrayValueForKey:@"listEditorObjectArray"]
addObject:leo];
[leo release];
}
Now I want to get reference the array to be able to grab the values
that are in it so I can save them.
Every time I try to access the listEditorObjectArray directly I get
something like
<NSKVONotifying_ListEditorObject: 0x162fcd0>
which looks like a pointer to the memory location for the data I
want, but not the actual data.
So, how do I access this data? And more generally how can I access
the NSArrayController to be able to call methods like "selectionIndex"?
Thanks,
Kane
_______________________________________________
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