forked from joshaber/JAListView
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DemoSectionView.m
57 lines (41 loc) · 1.14 KB
/
DemoSectionView.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// DemoSectionView.m
// JAListView
//
// Created by Josh Abernathy on 11/26/10.
// Copyright 2010 Maybe Apps. All rights reserved.
//
#import "DemoSectionView.h"
@implementation DemoSectionView
+ (DemoSectionView *)demoSectionView {
static NSNib *nib = nil;
if(nib == nil) {
nib = [[NSNib alloc] initWithNibNamed:NSStringFromClass(self) bundle:nil];
}
NSArray *objects = nil;
[nib instantiateNibWithOwner:nil topLevelObjects:&objects];
for(id object in objects) {
if([object isKindOfClass:self]) {
return object;
}
}
NSAssert1(NO, @"No view of class %@ found.", NSStringFromClass(self));
return nil;
}
#pragma mark NSView
- (void)drawRect:(NSRect)dirtyRect {
[super drawRect:dirtyRect];
[[NSColor lightGrayColor] set];
NSRectFill(dirtyRect);
}
#pragma mark API
@synthesize textField;
@synthesize shadowTextField;
- (void)setText:(NSString *)text {
[self.textField setStringValue:[[text copy] autorelease]];
[self.shadowTextField setStringValue:[[text copy] autorelease]];
}
- (NSString *)text {
return [self.textField stringValue];
}
@end