-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhotoArchiveStore.m
More file actions
50 lines (45 loc) · 932 Bytes
/
PhotoArchiveStore.m
File metadata and controls
50 lines (45 loc) · 932 Bytes
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
//
// PhotoArchiveStore.m
// Metasome
//
// Created by Omar Metwally on 9/12/13.
// Copyright (c) 2013 Logisome. All rights reserved.
//
#import "PhotoArchiveStore.h"
@implementation PhotoArchiveStore
+(id)allocWithZone:(NSZone *)zone
{
return [self sharedStore];
}
+(PhotoArchiveStore *)sharedStore
{
static PhotoArchiveStore *sharedStore = nil;
if (!sharedStore) {
// Create a singleton
sharedStore = [[super allocWithZone:NULL] init];
}
return sharedStore;
}
-(id)init
{
self = [super init];
if (self) {
dictionary = [[NSMutableDictionary alloc] init];
}
return self;
}
-(void)setImage:(UIImage *)i forKey:(NSString *)s
{
[dictionary setObject:i forKey:s];
}
-(UIImage *)imageForKey:(NSString *)s
{
return [dictionary objectForKey:s];
}
-(void)deleteImageForKey:(NSString *)s
{
if (!s)
return;
[dictionary removeObjectForKey:s];
}
@end