Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ios
/
yh_sdwebimage
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
DreamPiggy
7 years ago
Commit
49acbdf9a97f9c6f1c92cba2577eae82d73bc0e4
1 parent
71caeb82
Fix that iOS 8 NSURLSessionTaskPriorityHigh symbol not defined in Foundation fra…
…mework and cause crash
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
SDWebImage/SDWebImageDownloaderOperation.m
SDWebImage/SDWebImageDownloaderOperation.m
View file @
49acbdf
...
...
@@ -14,6 +14,13 @@
#define LOCK(lock) dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER);
#define UNLOCK(lock) dispatch_semaphore_signal(lock);
// iOS 8 Foundation.framework extern these symbol but the define is in CFNetwork.framework. We just fix this without import CFNetwork.framework
#if (__IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0)
const
float
NSURLSessionTaskPriorityHigh
=
0
.
75
;
const
float
NSURLSessionTaskPriorityDefault
=
0
.
5
;
const
float
NSURLSessionTaskPriorityLow
=
0
.
25
;
#endif
NSString
*
const
SDWebImageDownloadStartNotification
=
@"SDWebImageDownloadStartNotification"
;
NSString
*
const
SDWebImageDownloadReceiveResponseNotification
=
@"SDWebImageDownloadReceiveResponseNotification"
;
NSString
*
const
SDWebImageDownloadStopNotification
=
@"SDWebImageDownloadStopNotification"
;
...
...
@@ -176,7 +183,6 @@ typedef NSMutableDictionary<NSString *, id> SDCallbacksDictionary;
}
if
(
self
.
dataTask
)
{
[
self
.
dataTask
resume
];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
if
([
self
.
dataTask
respondsToSelector
:
@selector
(
setPriority
:)])
{
...
...
@@ -187,6 +193,7 @@ typedef NSMutableDictionary<NSString *, id> SDCallbacksDictionary;
}
}
#pragma clang diagnostic pop
[
self
.
dataTask
resume
];
for
(
SDWebImageDownloaderProgressBlock
progressBlock
in
[
self
callbacksForKey
:
kProgressCallbackKey
])
{
progressBlock
(
0
,
NSURLResponseUnknownLength
,
self
.
request
.
URL
);
}
...
...
Please
register
or
login
to post a comment