Re: setFrameSize called multiple times for a single size change?
Re: setFrameSize called multiple times for a single size change?
- Subject: Re: setFrameSize called multiple times for a single size change?
- From: Stuart Malin <email@hidden>
- Date: Tue, 21 Jul 2009 09:32:39 -0700
On Jul 21, 2009, at 9:27 AM, Kyle Sluder wrote:
On Tue, Jul 21, 2009 at 9:17 AM, Stuart Malin<email@hidden>
wrote:
I have a sub-classed TableView that is the document view of an
ScrollView.
For future reference: TableView and ScrollView are not names of
classes in Cocoa. NSTableView and NSScrollView are; UITableView and
UIScrollView exist in Cocoa Touch, so it's important to make this
distinction.
Good point. I was referring to NS, not UI, and will be clearer in the
future.
The rows of the TableView are composited by a custom cell, and soI
have
overridden the -setFrameSize method of the TableView in order to
determine
if any rows have changed height as a consequence of the resize (if
so, I
invoke -noteHeightOfRowsWithIndexesChanged). After performing that
calculation (and call to inform the table if any rows did change
height), I
then call the -setFrameSize of the super class (the NSTableView).
You're doing this backwards. Your delegate should be telling your
table view the size of the rows. Have your delegate listen for
NSViewFrameDidChangeNotification from the table view, and have it call
-noteHeightOfRowsWithIndexesChanged:.
Ah yes, this makes sense -- I will recode. Thank you Kyle!
_______________________________________________
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