NSArrayController selectNext updating late
NSArrayController selectNext updating late
- Subject: NSArrayController selectNext updating late
- From: Kane Dijkman <email@hidden>
- Date: Sun, 11 Sep 2005 19:53:35 -0700
I have an NSArrayController with a list of values in it that is Bound
to an NSTableView. Lets say 1, 2, 3
I have a button to step through the list and run some code to update
the display using selectNext and then getting the selectedObjects.
The problem is that if I am on value 1 and hit the button that does
the selectNext and then update the dispaly, the display gets updated
for value 1 and then once the update code is done the NSTableView
then selects the next value of 2.
Likvewise when two is selected and the button is pressed 2 gets
updated and then 3 gets selected. When I am expecting that 3 should
get selected and then the view would be updated for 3.
So, why is the update happening before the select changes? And how
can I fix this?
Here is the relevant code:
\/ The button calls the next: method.
- (IBAction)next:(id)sender
{
[listController selectNext:self];
[self display];
}
- (IBAction)display
{
NSMutableArray * theObjectArray = [listController selectedObjects];
NSString * theSymbol = [[theObjectArray objectAtIndex:0] symbol];
NSLog(@"theSymbol %@", theSymbol);
...
do stuff to update display
...
}
Thanks,
Kane
----------------------------------------------------------------
Never ask a man what computer he uses. If it's a Mac, he'll tell you.
If it's not, why embarrass him? - Tom Clancy
_______________________________________________
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