NSTableView reloadData not working?
NSTableView reloadData not working?
- Subject: NSTableView reloadData not working?
- From: Michael Becker <email@hidden>
- Date: Mon, 24 Nov 2003 22:41:59 +0100
Hi!
When drag&dropping several image files into my tableview, I create
thumbnails of these images and display them. As resizing the images may
take a while I want to keep the user informed that something is
happening, so he doesn't think the app crashed or whatever.
I've implemented an NSProgressIndicator which works well, but I also
wanted to have each thumbnail displayed as soon as the resizing is
through.
In my - tableView:acceptDrop: ... method I have the following loop:
for(i=0; i<[fileArray count]; i++) {
NSString *path = [fileArray objectAtIndex:i];
[ listManager addImage:path];
NSLog(@"Pictures resized: %d, listManager count: %d", i, [
listManager listCount]);
[ pTableView reloadData];
}
listManager is a custom class that takes care of the images and stores
them in its own arrays. The NSTableView delegate method
-numberOfRowsInTableView: asks listManager for the current image count
to know how many rows it should display. Everything works beautifully
so far.
However, the table is only reloaded after ALL thumbnails are created,
whereas the NSLog() command outputs its messages in nice intervals
(supposedly everytime an image has been resized).
Why doesnt the TableView reload each time an image has been resized and
added to my ListManager? (I also tried -setNeedsDisplay:YES ... same
result)
Bye,
Michael
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.