Skip to content

Commit

Permalink
Merge pull request #25 from pinterest/fixXcode7Warnings
Browse files Browse the repository at this point in the history
Fix Xcode 7 warnings
  • Loading branch information
garrettmoon committed Aug 24, 2015
2 parents aa9820b + bca5c3d commit b15266b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions PINCache/PINCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ typedef void (^PINCacheObjectBlock)(PINCache *cache, NSString *key, id __nullabl
*/
+ (instancetype)sharedCache;

- (instancetype)init NS_UNAVAILABLE;

/**
Multiple instances with the same name are allowed and can safely access
the same data on disk thanks to the magic of seriality. Also used to create the <diskCache>.
Expand Down
6 changes: 6 additions & 0 deletions PINCache/PINCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ - (void)dealloc
}
#endif

- (instancetype)init
{
@throw [NSException exceptionWithName:@"Must initialize with a name" reason:@"PINCache must be initialized with a name. Call initWithName: instead." userInfo:nil];
return [self initWithName:@""];
}

- (instancetype)initWithName:(NSString *)name
{
return [self initWithName:name rootPath:[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject]];
Expand Down
1 change: 1 addition & 0 deletions PINCache/PINDiskCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ typedef void (^PINDiskCacheObjectBlock)(PINDiskCache *cache, NSString *key, id <
*/
+ (void)emptyTrash;

- (instancetype)init NS_UNAVAILABLE;

/**
Multiple instances with the same name are allowed and can safely access
Expand Down
6 changes: 6 additions & 0 deletions PINCache/PINDiskCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ - (void)dealloc
#endif
}

- (instancetype)init
{
@throw [NSException exceptionWithName:@"Must initialize with a name" reason:@"PINDiskCache must be initialized with a name. Call initWithName: instead." userInfo:nil];
return [self initWithName:@""];
}

- (instancetype)initWithName:(NSString *)name
{
return [self initWithName:name rootPath:[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]];
Expand Down

0 comments on commit b15266b

Please sign in to comment.