Re: cocoa bindings and strings shown in 2 different lines of the same table column and row delay in displaying
Re: cocoa bindings and strings shown in 2 different lines of the same table column and row delay in displaying
- Subject: Re: cocoa bindings and strings shown in 2 different lines of the same table column and row delay in displaying
- From: Scott Stevenson <email@hidden>
- Date: Mon, 27 Nov 2006 00:44:12 -0800
On Nov 26, 2006, at 10:38 PM, vibhatha v wrote:
My problem is now, when the table selection changes, since i have
bound that
particular table column, my table view cell displays "string1|
rstring2"
intially and after some time gap,
goes to -(void)tableView:(NSTableView *)aTableView willDisplayCell:
(id)aCell
forTableColumn:(NSTableColumn*)aTableColumn row:(int)rowIndex
function and then displays the string as expected with different
fonts.
This is not what the willDisplayCell method is designed for. Use the
NSTableView datasource methods instead:
-numberOfRowsInTableView:
-tableView:objectValueForTableColumn:row:
-tableView:setObjectValue:forTableColumn:row:
Alternately, you can use the Cocoa Bindings only approach with
NSArrayController. I think this is much easier. You don't need to
implement the above methods if you use Cocoa Bindings.
I think this will help you tremendously:
<http://cocoadevcentral.com/articles/000080.php>
Also, you're probably better off with "\n" for line breaks in Mac OS
X instead of "\r".
- Scott
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden