• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSURLSession delegate not being called in iOS Simulator
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSURLSession delegate not being called in iOS Simulator


  • Subject: NSURLSession delegate not being called in iOS Simulator
  • From: Steve Christensen <email@hidden>
  • Date: Wed, 07 Jan 2015 15:35:25 -0800

An app I'm working on connects to our server with SSL. The production server has an SSL certificate but the development server does not. When testing new server code on the development server I initialize the NSURLSession with [NSURLSession sessionWithConfiguration:delegate:delegateQueue:], passing self as the delegate. The class implements -URLSession:didReceiveChallenge:completionHandler:, which diddles around to allow the connection to proceed without a certificate.

When I build and run the app in the Simulator, calls to -[session dataTaskWithRequest:completionHandler:] now complete with an error NSURLErrorDomain error -1005 (NSURLErrorNetworkConnectionLost) and the delegate method is not being called. The delegate method *does* get called when running on a real device.

This has worked fine in the past –both on real devices and in the Simulator– and still works fine on real devices running both iOS 7 and 8. I haven't had to connect to the development server for a while so the only change I can think of in that time is an update to Xcode 6.1.1. Have I missed something?


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Prev by Date: Re: NSOutlineView click and bug
  • Next by Date: Re: Blurry is the New Sharp
  • Previous by thread: Re: Saving NSAttributedString to a File
  • Next by thread: Displaying a scaling, relative time or date
  • Index(es):
    • Date
    • Thread