Merge pull request #42 from jwilling/fix-tablecellview

Modify NSTableCellView a bit.
This commit is contained in:
Justin Spahr-Summers 2012-10-25 18:41:10 -07:00
Родитель 5ed7ec3bd9 959d726b32
Коммит 65cdfe4454
3 изменённых файлов: 11 добавлений и 7 удалений

Просмотреть файл

@ -13,9 +13,12 @@
// Useful to clear properties and bindings before reuse.
@interface RBLTableCellView : NSTableCellView
// Called immediately before the cell view is going to be added
// to a new table row view. At the time this is called, the cell
// view will not have a superview.
// Called when the cell view has either been removed from
// its superview (the row view), or has just been created.
//
// Either way, the cell will not have a superview during this
// time and will be in an enqueued state.
- (void)prepareForReuse;
@end

Просмотреть файл

@ -10,12 +10,12 @@
@implementation RBLTableCellView
- (void)viewWillMoveToSuperview:(NSView *)newSuperview {
[super viewWillMoveToSuperview:newSuperview];
if (self.superview == nil && newSuperview != nil) {
- (void)viewDidMoveToSuperview {
if (self.superview == nil) {
[self prepareForReuse];
}
[super viewDidMoveToSuperview];
}
- (void)prepareForReuse {

Просмотреть файл

@ -15,3 +15,4 @@
#import <Rebel/RBLView.h>
#import <Rebel/CAAnimation+RBLBlockAdditions.h>
#import <Rebel/RBLPopover.h>
#import <Rebel/RBLTableCellView.h>