问题
Doubtful that this is a widespread issue, but hoping someone could help if they've had a similar problem.
I'm having this weird issue that only appears when running my App on the device, Alamofire works fine in the simulator. This started to appear after I upgraded to iOS 9.1 on my device.
Now when I test the app on my device, as soon as I make my first Alamofire request, an EXC_BAD_ACCESS appears on the var components line under the defaultHTTPHeaders > acceptLanguage block (see Image)
The Code making the request is:
Alamofire.request(.GET, "/api/index.php", parameters: ["version": "1"]).responseJSON{
response in
if(response.result.isSuccess)
{...
Using Breakpoints shows that the code does not progress to the ResponseJSON method.
Any help is really appreciated!
Thanks,
回答1:
So I stumbled across this post in the Github: https://github.com/Alamofire/Alamofire/issues/881
Turns out that for whatever reason - you may need to delete your Derived Data folder if this starts happening.
To do so, navigate here:
~/Library/Developer/Xcode/DerivedData
Delete the folders that relate to your app causing this issue. This should fix it!
来源:https://stackoverflow.com/questions/33403752/alamofire-3-0-exc-bad-access-on-ios-9-1