forked from smorr/Mach-O-Scope
/
MOSDifference.m
54 lines (44 loc) · 981 Bytes
/
MOSDifference.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
//
// ChangedMethod.m
// Mach-O-scope
//
// Created by Karsten Kusche on 27.08.11.
// Copyright 2011 Briksoftware.com. All rights reserved.
//
#import "MOSDifference.h"
#import "MOSClass.h"
@implementation MOSDifference
@synthesize mclass;
- (NSString*)differenceKind
{
return [self className];
}
- (NSString*)differenceDetail
{
return self.mclass.className;
}
- (NSString*)description
{
return [NSString stringWithFormat:@"%@ - %@",[self differenceKind],[self differenceDetail]];
}
+ (id)difference
{
MOSDifference* inst = [[self alloc] init];
return [inst autorelease];
}
- (void)initWithObject:(id)object
{
self.mclass = object;
}
+ (NSArray*)differencesFromObjects:(NSArray*)objects
{
NSMutableArray* differences = [NSMutableArray arrayWithCapacity:[objects count]];
for (id object in objects)
{
MOSDifference* difference = [self difference];
[difference initWithObject:object];
[differences addObject:difference];
}
return differences;
}
@end