-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathPDKeychainBindings.m
59 lines (43 loc) · 1.62 KB
/
PDKeychainBindings.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
55
56
57
58
59
//
// PDKeychainBindings.m
// PDKeychainBindings
//
// Created by Carl Brown on 7/10/11.
// Copyright 2011 PDAgent, LLC. Released under MIT License.
//
#import "PDKeychainBindings.h"
#import "PDKeychainBindingsController.h"
@implementation PDKeychainBindings
+ (PDKeychainBindings *)sharedKeychainBindings
{
return [[PDKeychainBindingsController sharedKeychainBindingsController] keychainBindings];
}
- (id)init
{
self = [super init];
if (self) {
// Initialization code here.
}
return self;
}
- (void)dealloc
{
[super dealloc];
}
- (id)objectForKey:(NSString *)defaultName {
//return [[[PDKeychainBindingsController sharedKeychainBindingsController] valueBuffer] objectForKey:defaultName];
return [[PDKeychainBindingsController sharedKeychainBindingsController] valueForKeyPath:[NSString stringWithFormat:@"values.%@",defaultName]];
}
- (void)setObject:(NSString *)value forKey:(NSString *)defaultName {
[[PDKeychainBindingsController sharedKeychainBindingsController] setValue:value forKeyPath:[NSString stringWithFormat:@"values.%@",defaultName]];
}
- (void)setString:(NSString *)value forKey:(NSString *)defaultName {
[[PDKeychainBindingsController sharedKeychainBindingsController] setValue:value forKeyPath:[NSString stringWithFormat:@"values.%@",defaultName]];
}
- (void)removeObjectForKey:(NSString *)defaultName {
[[PDKeychainBindingsController sharedKeychainBindingsController] setValue:nil forKeyPath:[NSString stringWithFormat:@"values.%@",defaultName]];
}
- (NSString *)stringForKey:(NSString *)defaultName {
return (NSString *) [self objectForKey:defaultName];
}
@end