From bb5bd74b813bbc28368dc1283f1e96cf71bba124 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Fri, 23 Mar 2018 22:09:04 +0800 Subject: [PATCH] Fix the wrong declaration of NSArray generics --- SDWebImage/SDWebImageCodersManager.h | 2 +- SDWebImage/SDWebImageCodersManager.m | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SDWebImage/SDWebImageCodersManager.h b/SDWebImage/SDWebImageCodersManager.h index 5c3d4b37..7523ecba 100644 --- a/SDWebImage/SDWebImageCodersManager.h +++ b/SDWebImage/SDWebImageCodersManager.h @@ -39,7 +39,7 @@ /** All coders in coders manager. The coders array is a priority queue, which means the later added coder will have the highest priority */ -@property (nonatomic, strong, readwrite, nullable) NSArray* coders; +@property (nonatomic, strong, readwrite, nullable) NSArray> *coders; /** Add a new coder to the end of coders array. Which has the highest priority. diff --git a/SDWebImage/SDWebImageCodersManager.m b/SDWebImage/SDWebImageCodersManager.m index 6134aa88..45595759 100644 --- a/SDWebImage/SDWebImageCodersManager.m +++ b/SDWebImage/SDWebImageCodersManager.m @@ -59,15 +59,15 @@ }); } -- (NSArray *)coders { - __block NSArray *sortedCoders = nil; +- (NSArray> *)coders { + __block NSArray> *sortedCoders = nil; dispatch_sync(self.mutableCodersAccessQueue, ^{ - sortedCoders = (NSArray *)[[[self.mutableCoders copy] reverseObjectEnumerator] allObjects]; + sortedCoders = (NSArray> *)[[[self.mutableCoders copy] reverseObjectEnumerator] allObjects]; }); return sortedCoders; } -- (void)setCoders:(NSArray *)coders { +- (void)setCoders:(NSArray> *)coders { dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{ self.mutableCoders = [coders mutableCopy]; });