зеркало из https://github.com/github/Rebel.git
Merge pull request #42 from jwilling/fix-tablecellview
Modify NSTableCellView a bit.
This commit is contained in:
Коммит
65cdfe4454
|
@ -13,9 +13,12 @@
|
||||||
// Useful to clear properties and bindings before reuse.
|
// Useful to clear properties and bindings before reuse.
|
||||||
@interface RBLTableCellView : NSTableCellView
|
@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
|
// Called when the cell view has either been removed from
|
||||||
// view will not have a superview.
|
// 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;
|
- (void)prepareForReuse;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -10,12 +10,12 @@
|
||||||
|
|
||||||
@implementation RBLTableCellView
|
@implementation RBLTableCellView
|
||||||
|
|
||||||
- (void)viewWillMoveToSuperview:(NSView *)newSuperview {
|
- (void)viewDidMoveToSuperview {
|
||||||
[super viewWillMoveToSuperview:newSuperview];
|
if (self.superview == nil) {
|
||||||
|
|
||||||
if (self.superview == nil && newSuperview != nil) {
|
|
||||||
[self prepareForReuse];
|
[self prepareForReuse];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[super viewDidMoveToSuperview];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)prepareForReuse {
|
- (void)prepareForReuse {
|
||||||
|
|
|
@ -15,3 +15,4 @@
|
||||||
#import <Rebel/RBLView.h>
|
#import <Rebel/RBLView.h>
|
||||||
#import <Rebel/CAAnimation+RBLBlockAdditions.h>
|
#import <Rebel/CAAnimation+RBLBlockAdditions.h>
|
||||||
#import <Rebel/RBLPopover.h>
|
#import <Rebel/RBLPopover.h>
|
||||||
|
#import <Rebel/RBLTableCellView.h>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче