Re: How to: NSTableView redisplay
Re: How to: NSTableView redisplay
- Subject: Re: How to: NSTableView redisplay
- From: Graham Cox <email@hidden>
- Date: Wed, 29 Feb 2012 19:25:03 +1100
On 29/02/2012, at 5:47 PM, Jens Alfke wrote:
>
> On Feb 28, 2012, at 8:39 PM, Erik Stainsby wrote:
>
>> [_rules addObject: rule];
>> [table reloadData];
>> [table setNeedsDisplay:YES];
>
> IIRC you need to call -noteNumberOfRowsChanged instead, if you've change the number of rows. -reloadData is just for reloading the existing rows.
That's news to me - I've always just called -reloadData. I believe it queries the rowCount, and then marks as needing redisplay those rows that are visible. This might be less optimal that reloading only the changed rows, but as far as I know, this has always worked fine for me.
Erik's code looks OK, but we don't know that the outlet <table> is actually pointing to anything, or that it's pointing to the correct thing. That's what I'd check first - set a breakpoint in appendRule: and have a look at it.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden