Fix compile errors
[pithos-ios] / Classes / VirtualIP.m
1 //
2 //  VirtualIP.m
3 //  OpenStack
4 //
5 //  Created by Michael Mayo on 2/9/11.
6 //  Copyright 2011 __MyCompanyName__. All rights reserved.
7 //
8
9 #import "VirtualIP.h"
10 #import "NSObject+NSCoding.h"
11
12
13 @implementation VirtualIP
14
15 @synthesize identifier, address, type, ipVersion;
16
17 #pragma mark -
18 #pragma mark Serialization
19
20 - (void)encodeWithCoder: (NSCoder *)coder {
21     [self autoEncodeWithCoder:coder];
22 }
23
24 - (id)initWithCoder:(NSCoder *)coder {
25     if (self = [super init]) {
26         [self autoDecode:coder];
27     }
28     return self;
29 }
30
31 #pragma mark -
32 #pragma mark JSON
33
34 + (VirtualIP *)fromJSON:(NSDictionary *)dict {
35     VirtualIP *virtualIP = [[[VirtualIP alloc] init] autorelease];
36     virtualIP.identifier = [dict objectForKey:@"id"];
37     virtualIP.address = [dict objectForKey:@"address"];
38     virtualIP.type = [dict objectForKey:@"type"];
39     virtualIP.ipVersion = [dict objectForKey:@"ipVersion"];
40     return virtualIP;
41 }
42
43 #pragma mark -
44 #pragma mark Memory Management
45
46 - (void)dealloc {
47     [identifier release];
48     [address release];
49     [type release];
50     [super dealloc];
51 }
52
53 @end