/
GBMethodSectionData.m
47 lines (36 loc) · 959 Bytes
/
GBMethodSectionData.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
//
// GBMethodSectionData.m
// appledoc
//
// Created by Tomaz Kragelj on 22.9.10.
// Copyright (C) 2010, Gentle Bytes. All rights reserved.
//
#import "GBMethodData.h"
#import "GBMethodSectionData.h"
@implementation GBMethodSectionData
#pragma mark Helper methods
- (void)registerMethod:(GBMethodData *)method {
NSParameterAssert(method != nil);
if (!_methods) _methods = [[NSMutableArray alloc] init];
[_methods addObject:method];
method.methodSection = self;
}
- (BOOL)unregisterMethod:(GBMethodData *)method {
if ([_methods containsObject:method]) {
[_methods removeObject:method];
method.methodSection = nil;
return YES;
}
return NO;
}
#pragma mark Overiden methods
- (NSString *)description {
return self.sectionName;
}
- (NSString *)debugDescription {
return [NSString stringWithFormat:@"%@: %@", [self className], self.sectionName];
}
#pragma mark Properties
@synthesize sectionName;
@synthesize methods = _methods;
@end