Alamofire 3.0 - EXC_BAD_ACCESS on iOS 9.1

笑着哭i 提交于 2019-12-23 02:41:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!