Simple bindings problem.
Simple bindings problem.
- Subject: Simple bindings problem.
- From: Juan Pablo Pertierra <email@hidden>
- Date: Mon, 6 Dec 2004 00:02:27 -0500
Hello,
I have been banging my head for three days and I can't figure this out, hopefully someone can point me in the right direction. I searched the Archives but didn't find an instance of this particular problem.
I have a NSTableView and a Button on my window. The NSTableView is bound to an NSArrayController, i originally based it on the Apple 'fiendishthgs' Quicktime sample, but I double-checked the bindings with other Cocoa samples.
In the 'init' for my controller, i enter a test value into the table, and also popup an open file dialog and add the name of the file as a second item. This all works fine:
- ()init
{
( = [ init])
{
takes = [[NSMutableArray alloc] init];
TakeDesc *newTake = [TakeDesc withName: andSpace: andDepth: andMode:];
[takes addObject:newTake];
NSOpenPanel *filePanel = [NSOpenPanel openPanel];
[filePanel runModalForTypes:];
newTake = [TakeDesc withName:[[[filePanel filenames] objectAtIndex:] lastPathComponent] andSpace: andDepth: andMode:];
[takes addObject:newTake];
}
;
}
These two items show up immediately as expected.
The problem is that I want to add items to the list as a an action of a button(process:). When I attempt this, the item doesn't show up. Note that it is the same code as above:
- ()sender
{
TakeDesc *newTake2 = [TakeDesc withName: andSpace: andDepth: andMode:];
[takes addObject:newTake2];
[currentBatchTable reloadData];
}
I later figured out that i can make the item appear by clicking on the column header of the first column, thus requesting a sort.
Does anyone have any idea why the code works on the init function, but works differently in the action method? From what i've found, the :reloadData should take care of redrawing the table, but it obviously does not. currentBatchTable is the outlet from the MyController class to the NSTableView, defined in IB as usual.
I am using XCode 1.1.
Thanks for your time,
Juan
_______________________________________________
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