{"action":"created","issue":{"url":"https://api.github.com/repos/rs/SDWebImage/issues/1366","labels_url":"https://api.github.com/repos/rs/SDWebImage/issues/1366/labels{/name}","comments_url":"https://api.github.com/repos/rs/SDWebImage/issues/1366/comments","events_url":"https://api.github.com/repos/rs/SDWebImage/issues/1366/events","html_url":"https://github.com/rs/SDWebImage/issues/1366","id":117167644,"number":1366,"title":"SDWebImagePrefetcher iOS9","user":{"login":"standers67","id":15874621,"avatar_url":"https://avatars.githubusercontent.com/u/15874621?v=3","gravatar_id":"","url":"https://api.github.com/users/standers67","html_url":"https://github.com/standers67","followers_url":"https://api.github.com/users/standers67/followers","following_url":"https://api.github.com/users/standers67/following{/other_user}","gists_url":"https://api.github.com/users/standers67/gists{/gist_id}","starred_url":"https://api.github.com/users/standers67/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/standers67/subscriptions","organizations_url":"https://api.github.com/users/standers67/orgs","repos_url":"https://api.github.com/users/standers67/repos","events_url":"https://api.github.com/users/standers67/events{/privacy}","received_events_url":"https://api.github.com/users/standers67/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-16T16:50:42Z","updated_at":"2015-11-16T17:38:29Z","closed_at":null,"body":"I am unable to use the SDWebImagePrefetcher to prefetch images. I am using the iOS 9.1 SDK and have tried to setup some very basic code to preload a few images. Adding more than 2 URLs to the array, makes the code hang.\r\n\r\n// The following code works...\r\nNSMutableArray *imageURLs = [NSMutableArray arrayWithCapacity:10];\r\n[imageURLs addObject:[NSURL URLWithString:@\"http://site.com/images/41/65/53/3696931799c.png\"]];\r\n[imageURLs addObject:[NSURL URLWithString:@\"http://site.com/images/41/65/53/3696922399c.png\"]];\r\n[[SDWebImagePrefetcher sharedImagePrefetcher] prefetchURLs:imageURLs];\r\n\r\n\r\n// The following code with one more url does not... (app hangs)\r\nNSMutableArray *imageURLs = [NSMutableArray arrayWithCapacity:10];\r\n[imageURLs addObject:[NSURL URLWithString:@\"http://site.com/images/41/65/53/3696931799c.png\"]];\r\n[imageURLs addObject:[NSURL URLWithString:@\"http://site.com/images/41/65/53/3696922399c.png\"]];\r\n[imageURLs addObject:[NSURL URLWithString:@\"http://site.com/images/41/65/53/3476922399c.png\"]];\r\n[[SDWebImagePrefetcher sharedImagePrefetcher] prefetchURLs:imageURLs];\r\n\r\nI am using the latest release of the SDWebImage library. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rs/SDWebImage/issues/comments/157112742","html_url":"https://github.com/rs/SDWebImage/issues/1366#issuecomment-157112742","issue_url":"https://api.github.com/repos/rs/SDWebImage/issues/1366","id":157112742,"user":{"login":"standers67","id":15874621,"avatar_url":"https://avatars.githubusercontent.com/u/15874621?v=3","gravatar_id":"","url":"https://api.github.com/users/standers67","html_url":"https://github.com/standers67","followers_url":"https://api.github.com/users/standers67/followers","following_url":"https://api.github.com/users/standers67/following{/other_user}","gists_url":"https://api.github.com/users/standers67/gists{/gist_id}","starred_url":"https://api.github.com/users/standers67/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/standers67/subscriptions","organizations_url":"https://api.github.com/users/standers67/orgs","repos_url":"https://api.github.com/users/standers67/repos","events_url":"https://api.github.com/users/standers67/events{/privacy}","received_events_url":"https://api.github.com/users/standers67/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T17:38:29Z","updated_at":"2015-11-16T17:38:29Z","body":"Some more input, this seems to be the code location where it goes wrong:\r\n\r\nSDWebImagePrefetcher.m:128\r\ndispatch_apply(maxNumberOfImages/self.maxConcurrentDownloads, self.prefetcherQueue, ^(size_t index) {\r\n            size_t i = index * self.maxConcurrentDownloads;\r\n            size_t stop = i + self.maxConcurrentDownloads;\r\n            do {\r\n                [weakSelf startPrefetchingAtIndex:i++];\r\n            } while (i < stop);\r\n        });"}}