Alamofire 3.0 - EXC_BAD_ACCESS on iOS 9.1

2019-06-02 15:34发布

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)

enter image description here

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条回答
Root(大扎)
2楼-- · 2019-06-02 16:18

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!

查看更多
登录 后发表回答