iOS 5 Hanging on ASIHTTPRequests
Asked Answered
S

2

6

So I have an app that runs on iOS 3.2 - 4.x. It uses ASIHTTPRequest to make all the REST API calls. Ever since my team and I upgraded three of our iPhone 4's to iOS 5, The app will hang and show the ActivityIndicator indefinitely. I looked at the server logs and the requests aren't hitting the server.

However, if I press the iPhone home button then open the app again, the request will go through and I will receive the data, business as normal. For some reason the requests are never triggered until I reopen the app.

Another weird tidbit, the app works in Xcode 4.2 and the iPhone simulator. The app also works on an iPad2 with iOS 5 (the app is iPhone only).

Would this be an ASIHTTPRequest issue? Not too sure how to pinpoint the issue since there is no crash and only happens on the phone.

Any insight would be much appreciated! Thanks.

Senility answered 17/10, 2011 at 21:26 Comment(1)
I can +1 this. I'm getting all sorts of weird behavior ever since iOS 5 with ASI. Particularly after upgrading to the new Xcode. I have a theory that my old Xcode will compile these apps just fine. It started when I saw libz.1.2.3 was missing... hmmm that's strange. So I replaced it with 1.2.5. Everything seemed to work, but now I get a crash when I try to pop a view controller before the request finished. I solved this error a long time ago by retaining the view controller, but that no longer helps.Checklist
E
0

Of course I can't be certain without more details and a code sample, but a couple things about your description suggest one possibility for at least recreating the issue. The fact this works in the simulator and works after the app has been closed and reopened makes me think that your app may be receiving a memory warning at some point prior to when you experience this. During the cleanup that occurs as a result of that memory warning it is possible that something is getting unloaded which does not get properly reinitialized until you return to the app from the home screen. You can test this by simulating a memory warning while running in the Xcode 4.2 simulator, though you may need to figure out exactly where the memory warning occurs in order to duplicate the issue.

Earlearla answered 23/11, 2011 at 17:47 Comment(1)
Usually memory warnings get displayed in the log as Received memory warning. I too have that issue with ASIHTTP and iOS5 but I don't get any memory warnings. Probably will migrate from ASIHTTP to AFNetworking.Reisman
H
0

I am a novice at this so probably it was a lucky guess, but my problems were solved when I disabled the ARC and created the project. see if that can help.

Hoopes answered 5/4, 2012 at 16:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.