Fixed a crash happening only on iOS 6 devices using PubNub. #77
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was getting a crash when attempting to clear the sharedURLCache on iOS6. Strangely, the timeTokenRequest doesn't exist in the cache (maybe this is why it crashes?). In any case, I simply changed the init call to ensure it always hits the remote server and doesn't cache the response instead of assuming it caches and then removing the cached response.
Stack Trace for iOS 6 crash:
#0 0x39405e04 in dispatch_resume$VARIANT$up ()
#1 0x30fed274 in __CFURLCache::AddCacheTask0(__CFURLCacheNode*) ()
#2 0x30fecf7c in __CFURLCache::AddCacheTask(__CFURLCacheNode*) ()
#3 0x30fedf1e in CFURLCacheRemoveCachedResponseForRequest ()
#4 0x0039caf0 in __41-[PNReachability handleOriginLookupTimer]_block_invoke at /Users/schapman/workspace/Delphi_Mobile_Libs/Externals/PubNub/Network/PNReachability.m:527
#5 0x3940611e in _dispatch_call_block_and_release ()
#6 0x39414258 in _dispatch_root_queue_drain ()
#7 0x394143b8 in _dispatch_worker_thread2 ()
#8 0x3943aa10 in _pthread_wqthread ()