• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: setFrameSize called multiple times for a single size change?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >setFrameSize called multiple times for a single size change? (From: Stuart Malin <email@hidden>)
 >Re: setFrameSize called multiple times for a single size change? (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: setFrameSize called multiple times for a single size change?
  • Next by Date: Re: Crashes while reordering columns in a NSTableView
  • Previous by thread: Re: setFrameSize called multiple times for a single size change?
  • Next by thread: Re: setFrameSize called multiple times for a single size change?
  • Index(es):
    • Date
    • Thread