On 12 Dec 2008, at 8:41 pm, rajesh wrote:
do I add observer at cell level OR the controller level ( dataSource level ) ? I am confused because the user might just scroll through the tabel , in first go there are definitely no images , at the same time the cells which placed request for images might no longer be in the visible-rect of the Outline Table && every cell receives notification of every other image that got downloaded , so Is there any way to determine if the current cell which just got notified to determine if its in the visible-rect.
Just to make something clear: there is no cell *per row*, there is only one cell *per column*. The cell is 'moved' from row to row to draw its contents with new data for each row.
So registering for a notification at the cell level doesn't sound like the right thing to do - scrolling makes some rows visible and others no longer visible, but it's always the same cell.
I'd suggest that the way to do it is in the controller/datasource. When an image is delivered from the server, the controller can figure out what row that corresponds to and simply invalidate that row in the table. If it's visible, the table will ask the datasource for the image, which will now be available and can be returned immediately. If the row isn't visible, the table will do nothing. So the scrolling situation is taken care of automatically.
hth, Graham _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
