Fix the wrong declaration of NSArray generics

This commit is contained in:
DreamPiggy 2018-03-23 22:09:04 +08:00
parent dc5c974b89
commit bb5bd74b81
2 changed files with 5 additions and 5 deletions

View File

@ -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<SDWebImageCoder>* coders;
@property (nonatomic, strong, readwrite, nullable) NSArray<id<SDWebImageCoder>> *coders;
/**
Add a new coder to the end of coders array. Which has the highest priority.

View File

@ -59,15 +59,15 @@
});
}
- (NSArray<SDWebImageCoder> *)coders {
__block NSArray<SDWebImageCoder> *sortedCoders = nil;
- (NSArray<id<SDWebImageCoder>> *)coders {
__block NSArray<id<SDWebImageCoder>> *sortedCoders = nil;
dispatch_sync(self.mutableCodersAccessQueue, ^{
sortedCoders = (NSArray<SDWebImageCoder> *)[[[self.mutableCoders copy] reverseObjectEnumerator] allObjects];
sortedCoders = (NSArray<id<SDWebImageCoder>> *)[[[self.mutableCoders copy] reverseObjectEnumerator] allObjects];
});
return sortedCoders;
}
- (void)setCoders:(NSArray<SDWebImageCoder> *)coders {
- (void)setCoders:(NSArray<id<SDWebImageCoder>> *)coders {
dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{
self.mutableCoders = [coders mutableCopy];
});