diff --git a/SDWebImage/SDAnimatedImageView.h b/SDWebImage/SDAnimatedImageView.h index db904ace..e822c4ea 100644 --- a/SDWebImage/SDAnimatedImageView.h +++ b/SDWebImage/SDAnimatedImageView.h @@ -57,12 +57,14 @@ Default is YES. Set to NO to only render the static poster for incremental animated image. */ @property (nonatomic, assign) BOOL shouldIncrementalLoad; + +#if SD_UIKIT /** You can specify a runloop mode to let it rendering. Default is NSRunLoopCommonModes on multi-core iOS device, NSDefaultRunLoopMode on single-core iOS device */ -@property (nonatomic, copy, nonnull) NSRunLoopMode runLoopMode NS_AVAILABLE_IOS(3_1); - +@property (nonatomic, copy, nonnull) NSRunLoopMode runLoopMode; +#endif @end #endif diff --git a/SDWebImage/SDWebImageDownloader.m b/SDWebImage/SDWebImageDownloader.m index 71d96bd0..cc17dd89 100644 --- a/SDWebImage/SDWebImageDownloader.m +++ b/SDWebImage/SDWebImageDownloader.m @@ -133,6 +133,9 @@ static void * SDWebImageDownloaderContext = &SDWebImageDownloaderContext; } - (void)setValue:(nullable NSString *)value forHTTPHeaderField:(nullable NSString *)field { + if (!field) { + return; + } NSMutableDictionary *mutableHTTPHeaders = [self.HTTPHeaders mutableCopy]; if (value) { [mutableHTTPHeaders setObject:value forKey:field];