Browse Subversion Repository
Annotation of /XspfManager/XspfMCollectionViewController.m
Parent Directory
| Revision Log
Revision 16 -
( hide annotations)
( download)
Fri Nov 6 12:37:27 2009 UTC
(14 years, 5 months ago)
by masaki
File size: 1441 byte(s)
[misc] NSCollectionView部分を別のnibに分離。NSViewControllerで管理。
| 1 |
masaki |
16 |
// |
| 2 |
|
|
// XspfMCollectionViewController.m |
| 3 |
|
|
// XspfManager |
| 4 |
|
|
// |
| 5 |
|
|
// Created by Hori,Masaki on 09/11/05. |
| 6 |
|
|
// Copyright 2009 masakih. All rights reserved. |
| 7 |
|
|
// |
| 8 |
|
|
|
| 9 |
|
|
#import "XspfMCollectionViewController.h" |
| 10 |
|
|
|
| 11 |
|
|
|
| 12 |
|
|
@implementation XspfMCollectionViewController |
| 13 |
|
|
|
| 14 |
|
|
- (id)init |
| 15 |
|
|
{ |
| 16 |
|
|
[super initWithNibName:@"CollectionView" bundle:nil]; |
| 17 |
|
|
|
| 18 |
|
|
return self; |
| 19 |
|
|
} |
| 20 |
|
|
- (void)dealloc |
| 21 |
|
|
{ |
| 22 |
|
|
[[self view] removeObserver:self forKeyPath:@"nextResponder"]; |
| 23 |
|
|
|
| 24 |
|
|
[super dealloc]; |
| 25 |
|
|
} |
| 26 |
|
|
|
| 27 |
|
|
- (void)loadView |
| 28 |
|
|
{ |
| 29 |
|
|
[super loadView]; |
| 30 |
|
|
|
| 31 |
|
|
[[self view] addObserver:self |
| 32 |
|
|
forKeyPath:@"nextResponder" |
| 33 |
|
|
options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld |
| 34 |
|
|
context:NULL]; |
| 35 |
|
|
} |
| 36 |
|
|
|
| 37 |
|
|
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context |
| 38 |
|
|
{ |
| 39 |
|
|
if(![keyPath isEqualToString:@"nextResponder"]) { |
| 40 |
|
|
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; |
| 41 |
|
|
return; |
| 42 |
|
|
} |
| 43 |
|
|
id new = [change objectForKey:NSKeyValueChangeNewKey]; |
| 44 |
|
|
id old = [change objectForKey:NSKeyValueChangeOldKey]; |
| 45 |
|
|
if([new isEqual:old]) return; |
| 46 |
|
|
|
| 47 |
|
|
id nextResponder = [object nextResponder]; |
| 48 |
|
|
if([self isEqual:nextResponder]) return; |
| 49 |
|
|
|
| 50 |
|
|
[self setNextResponder:nextResponder]; |
| 51 |
|
|
[object setNextResponder:self]; |
| 52 |
|
|
} |
| 53 |
|
|
|
| 54 |
|
|
|
| 55 |
|
|
#pragma mark#### XspfMCollectionView Delegate #### |
| 56 |
|
|
- (void)enterAction:(XspfMCollectionView *)view |
| 57 |
|
|
{ |
| 58 |
|
|
[xspfManager openXspf:view]; |
| 59 |
|
|
} |
| 60 |
|
|
|
| 61 |
|
|
#pragma mark#### Test #### |
| 62 |
|
|
- (void)test01:(id)sender |
| 63 |
|
|
{ |
| 64 |
|
|
NSLog(@"hoge"); |
| 65 |
|
|
} |
| 66 |
|
|
|
| 67 |
|
|
|
| 68 |
|
|
@end |
|