зеркало из https://github.com/github/Rebel.git
Merge pull request #37 from jwilling/master
Add a NSTableCellView subclass for dequeue methods.
This commit is contained in:
Коммит
9f90894c0a
|
@ -1,4 +1,5 @@
|
|||
# Xcode
|
||||
.DS_Store
|
||||
build/*
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
306A81E81601E92000BF45F3 /* CAAnimation+RBLBlockAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 306A81E61601E92000BF45F3 /* CAAnimation+RBLBlockAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
306A81E91601E92000BF45F3 /* CAAnimation+RBLBlockAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 306A81E71601E92000BF45F3 /* CAAnimation+RBLBlockAdditions.m */; };
|
||||
306A81EB1601EAE700BF45F3 /* CAAnimation+RBLBlockAdditionsSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 306A81EA1601EAE700BF45F3 /* CAAnimation+RBLBlockAdditionsSpec.m */; };
|
||||
AB61F63616373FE000DD5D2C /* RBLTableCellView.h in Headers */ = {isa = PBXBuildFile; fileRef = AB61F63416373FE000DD5D2C /* RBLTableCellView.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
AB61F63716373FE000DD5D2C /* RBLTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = AB61F63516373FE000DD5D2C /* RBLTableCellView.m */; };
|
||||
D011FD5E16239A8600A27946 /* NSImage+RBLResizableImageAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = D011FD5C16239A8600A27946 /* NSImage+RBLResizableImageAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
D011FD5F16239A8600A27946 /* NSImage+RBLResizableImageAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = D011FD5D16239A8600A27946 /* NSImage+RBLResizableImageAdditions.m */; };
|
||||
D01A4A28162C81EE0092D61F /* libExpecta.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D01A4A0C162C81CC0092D61F /* libExpecta.a */; };
|
||||
|
@ -131,6 +133,8 @@
|
|||
306A81E71601E92000BF45F3 /* CAAnimation+RBLBlockAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CAAnimation+RBLBlockAdditions.m"; sourceTree = "<group>"; };
|
||||
306A81EA1601EAE700BF45F3 /* CAAnimation+RBLBlockAdditionsSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CAAnimation+RBLBlockAdditionsSpec.m"; sourceTree = "<group>"; };
|
||||
306A81EC1601F44200BF45F3 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
|
||||
AB61F63416373FE000DD5D2C /* RBLTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RBLTableCellView.h; sourceTree = "<group>"; };
|
||||
AB61F63516373FE000DD5D2C /* RBLTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RBLTableCellView.m; sourceTree = "<group>"; };
|
||||
D011FD5C16239A8600A27946 /* NSImage+RBLResizableImageAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSImage+RBLResizableImageAdditions.h"; sourceTree = "<group>"; };
|
||||
D011FD5D16239A8600A27946 /* NSImage+RBLResizableImageAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSImage+RBLResizableImageAdditions.m"; sourceTree = "<group>"; };
|
||||
D0410EA915C61895003A3203 /* NSTextView+RBLAntialiasingAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSTextView+RBLAntialiasingAdditions.h"; sourceTree = "<group>"; };
|
||||
|
@ -251,6 +255,8 @@
|
|||
D0723FBF15C5F9D8004DBDC7 /* RBLView.m */,
|
||||
306A81D91601C7A300BF45F3 /* RBLPopover.h */,
|
||||
306A81DA1601C7A300BF45F3 /* RBLPopover.m */,
|
||||
AB61F63416373FE000DD5D2C /* RBLTableCellView.h */,
|
||||
AB61F63516373FE000DD5D2C /* RBLTableCellView.m */,
|
||||
);
|
||||
name = Classes;
|
||||
sourceTree = "<group>";
|
||||
|
@ -449,6 +455,7 @@
|
|||
304692F21607259A00B79746 /* EXTKeyPathCoding.h in Headers */,
|
||||
D0E91C581603CC7600D23E93 /* RBLClipView.h in Headers */,
|
||||
D011FD5E16239A8600A27946 /* NSImage+RBLResizableImageAdditions.h in Headers */,
|
||||
AB61F63616373FE000DD5D2C /* RBLTableCellView.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -640,6 +647,7 @@
|
|||
306A81E91601E92000BF45F3 /* CAAnimation+RBLBlockAdditions.m in Sources */,
|
||||
D0E91C591603CC7600D23E93 /* RBLClipView.m in Sources */,
|
||||
D011FD5F16239A8600A27946 /* NSImage+RBLResizableImageAdditions.m in Sources */,
|
||||
AB61F63716373FE000DD5D2C /* RBLTableCellView.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// RBLTableCellView.h
|
||||
// Rebel
|
||||
//
|
||||
// Created by Jonathan Willing on 10/23/12.
|
||||
// Copyright (c) 2012 GitHub. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
// A subclass of NSTableCellView that adds a method
|
||||
// which notifies when the cell view will be reused.
|
||||
// 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.
|
||||
- (void)prepareForReuse;
|
||||
|
||||
@end
|
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// RBLTableCellView.m
|
||||
// Rebel
|
||||
//
|
||||
// Created by Jonathan Willing on 10/23/12.
|
||||
// Copyright (c) 2012 GitHub. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RBLTableCellView.h"
|
||||
|
||||
@implementation RBLTableCellView
|
||||
|
||||
- (void)viewWillMoveToSuperview:(NSView *)newSuperview {
|
||||
[super viewWillMoveToSuperview:newSuperview];
|
||||
|
||||
if (self.superview == nil && newSuperview != nil) {
|
||||
[self prepareForReuse];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)prepareForReuse {
|
||||
|
||||
}
|
||||
|
||||
@end
|
Загрузка…
Ссылка в новой задаче