Permalink
Browse files

Merge pull request #1 from chrisledet/master

Use self instead of using class name.
  • Loading branch information...
2 parents d73b705 + c905d86 commit 6e910cb8c5bf7ca99619725c1585c9963b3340c1 @granoff committed Apr 30, 2012
Showing with 12 additions and 12 deletions.
  1. +12 −12 Lockbox.m
View
@@ -49,23 +49,23 @@ +(BOOL)setObject:(NSString *)obj forKey:(NSString *)key
{
OSStatus status;
- NSString *hierKey = [Lockbox _hierarchicalKey:key];
+ NSString *hierKey = [self _hierarchicalKey:key];
// If the object is nil, delete the item
if (!obj) {
- NSMutableDictionary *query = [Lockbox _query];
+ NSMutableDictionary *query = [self _query];
[query setObject:hierKey forKey:(id)kSecAttrService];
status = SecItemDelete((CFDictionaryRef)query);
return (status == errSecSuccess);
}
- NSMutableDictionary *dict = [Lockbox _service];
+ NSMutableDictionary *dict = [self _service];
[dict setObject: hierKey forKey: (id) kSecAttrService];
[dict setObject: [obj dataUsingEncoding:NSUTF8StringEncoding] forKey: (id) kSecValueData];
status = SecItemAdd ((CFDictionaryRef) dict, NULL);
if (status == errSecDuplicateItem) {
- NSMutableDictionary *query = [Lockbox _query];
+ NSMutableDictionary *query = [self _query];
[query setObject:hierKey forKey:(id)kSecAttrService];
status = SecItemDelete((CFDictionaryRef)query);
if (status == errSecSuccess)
@@ -79,9 +79,9 @@ +(BOOL)setObject:(NSString *)obj forKey:(NSString *)key
+(NSString *)objectForKey:(NSString *)key
{
- NSString *hierKey = [Lockbox _hierarchicalKey:key];
+ NSString *hierKey = [self _hierarchicalKey:key];
- NSMutableDictionary *query = [Lockbox _query];
+ NSMutableDictionary *query = [self _query];
[query setObject:hierKey forKey: (id)kSecAttrService];
NSData *data = nil;
@@ -102,24 +102,24 @@ +(NSString *)objectForKey:(NSString *)key
+(BOOL)setString:(NSString *)value forKey:(NSString *)key
{
- return [Lockbox setObject:value forKey:key];
+ return [self setObject:value forKey:key];
}
+(NSString *)stringForKey:(NSString *)key
{
- return [Lockbox objectForKey:key];
+ return [self objectForKey:key];
}
+(BOOL)setArray:(NSArray *)value forKey:(NSString *)key
{
NSString *components = [value componentsJoinedByString:kDelimeter];
- return [Lockbox setObject:components forKey:key];
+ return [self setObject:components forKey:key];
}
+(NSArray *)arrayForKey:(NSString *)key
{
NSArray *array = nil;
- NSString *components = [Lockbox objectForKey:key];
+ NSString *components = [self objectForKey:key];
if (components)
array = [NSArray arrayWithArray:[components componentsSeparatedByString:kDelimeter]];
@@ -128,13 +128,13 @@ +(NSArray *)arrayForKey:(NSString *)key
+(BOOL)setSet:(NSSet *)value forKey:(NSString *)key
{
- return [Lockbox setArray:[value allObjects] forKey:key];
+ return [self setArray:[value allObjects] forKey:key];
}
+(NSSet *)setForKey:(NSString *)key
{
NSSet *set = nil;
- NSArray *array = [Lockbox arrayForKey:key];
+ NSArray *array = [self arrayForKey:key];
if (array)
set = [NSSet setWithArray:array];

0 comments on commit 6e910cb

Please sign in to comment.