Permalink
Browse files

Fix some ARC warnings around un-bridged id usage

  • Loading branch information...
1 parent 7f53937 commit 178ae711b6920136369353065387c2b41da2242f @granoff committed Nov 16, 2012
Showing with 16 additions and 10 deletions.
  1. +14 −8 Lockbox.m
  2. +2 −2 Lockbox.podspec
View
@@ -10,6 +10,12 @@
#define kDelimeter @"-|-"
+#if __has_feature(objc_arc)
+#define ID __bridge id
+#else
+#define ID id
+#endif
+
static NSString *_bundleId = nil;
@implementation Lockbox
@@ -23,7 +29,7 @@ +(NSMutableDictionary *)_service
{
NSMutableDictionary* dict = [NSMutableDictionary dictionary];
- [dict setObject: (id) kSecClassGenericPassword forKey: (id) kSecClass];
+ [dict setObject: (ID) kSecClassGenericPassword forKey: (ID) kSecClass];
return dict;
}
@@ -32,8 +38,8 @@ +(NSMutableDictionary *)_query
{
NSMutableDictionary* query = [NSMutableDictionary dictionary];
- [query setObject: (id) kSecClassGenericPassword forKey: (id) kSecClass];
- [query setObject: (id) kCFBooleanTrue forKey: (id) kSecReturnData];
+ [query setObject: (ID) kSecClassGenericPassword forKey: (ID) kSecClass];
+ [query setObject: (ID) kCFBooleanTrue forKey: (ID) kSecReturnData];
return query;
}
@@ -54,7 +60,7 @@ +(BOOL)setObject:(NSString *)obj forKey:(NSString *)key
// If the object is nil, delete the item
if (!obj) {
NSMutableDictionary *query = [self _query];
- [query setObject:hierKey forKey:(id)kSecAttrService];
+ [query setObject:hierKey forKey:(ID)kSecAttrService];
#if __has_feature(objc_arc)
status = SecItemDelete((__bridge CFDictionaryRef)query);
#else
@@ -64,8 +70,8 @@ +(BOOL)setObject:(NSString *)obj forKey:(NSString *)key
}
NSMutableDictionary *dict = [self _service];
- [dict setObject: hierKey forKey: (id) kSecAttrService];
- [dict setObject: [obj dataUsingEncoding:NSUTF8StringEncoding] forKey: (id) kSecValueData];
+ [dict setObject: hierKey forKey: (ID) kSecAttrService];
+ [dict setObject: [obj dataUsingEncoding:NSUTF8StringEncoding] forKey: (ID) kSecValueData];
#if __has_feature(objc_arc)
status = SecItemAdd ((__bridge CFDictionaryRef) dict, NULL);
@@ -74,7 +80,7 @@ +(BOOL)setObject:(NSString *)obj forKey:(NSString *)key
#endif
if (status == errSecDuplicateItem) {
NSMutableDictionary *query = [self _query];
- [query setObject:hierKey forKey:(id)kSecAttrService];
+ [query setObject:hierKey forKey:(ID)kSecAttrService];
#if __has_feature(objc_arc)
status = SecItemDelete((__bridge CFDictionaryRef)query);
#else
@@ -98,7 +104,7 @@ +(NSString *)objectForKey:(NSString *)key
NSString *hierKey = [self _hierarchicalKey:key];
NSMutableDictionary *query = [self _query];
- [query setObject:hierKey forKey: (id)kSecAttrService];
+ [query setObject:hierKey forKey: (ID)kSecAttrService];
CFDataRef data = nil;
OSStatus status =
View
@@ -1,12 +1,12 @@
Pod::Spec.new do |s|
s.name = 'Lockbox'
- s.version = '1.1.0'
+ s.version = '1.2.0'
s.license = 'MIT'
s.summary = 'Lockbox is an Objective-C utility class for storing data securely in the keychain. Use it to store small, sensitive bits of data securely.'
s.homepage = 'https://github.com/granoff/Lockbox'
s.author = 'Mark H. Granoff'
- s.source = { :git => 'https://github.com/granoff/Lockbox.git', :tag => '1.1.0' }
+ s.source = { :git => 'https://github.com/granoff/Lockbox.git', :tag => '1.2.0' }
s.source_files = 'Lockbox.{h,m}'
s.clean_path = 'LockBox'

0 comments on commit 178ae71

Please sign in to comment.