Skip to content

Commit

Permalink
Fix warnings in demo/viewer apps
Browse files Browse the repository at this point in the history
  • Loading branch information
dflems committed Sep 24, 2021
1 parent 693c656 commit 968e559
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@interface DetailViewController : UIViewController

@property (nonatomic, strong) SPTPersistentCache *persistentDataCache;
@property (strong, nonatomic) id detailItem;
@property (strong, nonatomic) NSObject *detailItem;
@property (nonatomic, weak, readwrite) IBOutlet UIImageView *detailImageView;

@end
Expand Down
19 changes: 10 additions & 9 deletions Viewer/MainWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Licensed to the Apache Software Foundation (ASF) under one
#import <SPTPersistentCache/SPTPersistentCache.h>

@interface MainWindowController () <NSTableViewDataSource, NSTableViewDelegate>
@property (nonatomic, strong) NSMutableArray *cacheFiles;
@property (nonatomic, strong) NSMutableArray<NSURL *> *cacheFiles;

@property (nonatomic, strong) NSString *magic;
@property (nonatomic, strong) NSString *headerSize;
Expand Down Expand Up @@ -112,10 +112,10 @@ -(BOOL)validateMenuItem:(NSMenuItem *)menuItem
- (void)loadFilesAtURL:(NSURL *)url
{
NSError *error = nil;
NSArray *files = [[NSFileManager defaultManager] contentsOfDirectoryAtURL:url
includingPropertiesForKeys:nil
options:NSDirectoryEnumerationSkipsHiddenFiles
error:&error];
NSArray<NSURL *> *files = [[NSFileManager defaultManager] contentsOfDirectoryAtURL:url
includingPropertiesForKeys:nil
options:NSDirectoryEnumerationSkipsHiddenFiles
error:&error];
if (files == nil) {
[NSApp presentError:error];
return;
Expand Down Expand Up @@ -144,8 +144,8 @@ - (void)tableViewSelectionDidChange:(NSNotification *)aNotification
return;
}

NSString *fullFilePath = [self.cacheFiles objectAtIndex:(NSUInteger)idx];
NSData *rawData = [NSData dataWithContentsOfFile:fullFilePath];
NSURL *fileURL = [self.cacheFiles objectAtIndex:(NSUInteger)idx];
NSData *rawData = [NSData dataWithContentsOfURL:fileURL];

SPTPersistentCacheRecordHeader *h = SPTPersistentCacheGetHeaderFromData(__DECONST(void*, [rawData bytes]), [rawData length]);

Expand Down Expand Up @@ -177,8 +177,9 @@ - (void)tableViewSelectionDidChange:(NSNotification *)aNotification

self.object = [[NSImage alloc] initWithData:self.payload];

self.imageView.image = self.object;
self.imageSize = NSStringFromSize([self.object size]);
NSImage *image = self.object;
self.imageView.image = image;
self.imageSize = NSStringFromSize([image size]);
}

@end

0 comments on commit 968e559

Please sign in to comment.