64710

Network error while switching from WiFi to 3G

Question:

My iPhone app is web based.It works fine while running in WiFi and in 3G But the problem is when I run the app on WiFi and minimize it,and turn off the WiFi and switch to 3G-it shows no network.

In user's case-when they use the app under WiFi and goes out it failed to connect with 3G network.I am using apple's Reachability class to check the network connection Anybody please tell any solution

Do i code something to reconnect if the connection lost or switch from WiFi to 3G ?

Answer1:

You can use connection:didFailWithError: and implement into your method to reconnect your user.

Like this

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { [self reconnect]; } - (void)reconnect { //reconnect your user }

I hope it can help you ! ;)

Recommend

  • How to add header line to CSV without loading whole file?
  • How do I clear the screen in C? [duplicate]
  • How to load Q library with Require.js?
  • if some function is not optimized does it mean that all functions where it is declared are not optim
  • Hide buttons on title bar in Java
  • Private IP address in reserved subnet range
  • Hide HTML elements without javascript, only CSS
  • Problems installing Yesod for Haskell
  • Copy to all folders batch file?
  • Unable to install Git-core+svn by MacPorts
  • Moving mysql files across servers
  • VSO Build — Response status code does not indicate success: 404 (Not Found)
  • Cannot resolve symbol 'MyApi'
  • ilmerge with a PFX file
  • Problems to linebreak with an int in JLabel
  • Controls, properties, events and timers running in design time
  • script to move all files from one location to another location
  • Join two tables and save into third-sql
  • JSON with duplicate key names losing information when parsed
  • Which linear programming package should I use for high numbers of constraints and “warm starts” [clo
  • How to model a transition system with SPIN
  • Updated Ionic CLI but shows previous version (Windows)
  • How to make Safari send if-modified-since header?
  • Adding custom controls to a full screen movie
  • ORA-29908: missing primary invocation for ancillary operator
  • How to pass list parameters for each object using Spring MVC?
  • SVN: Merging two branches together
  • Hibernate gives error error as “Access to DialectResolutionInfo cannot be null when 'hibernate.
  • Error creating VM instance in Google Compute Engine
  • -fvisibility=hidden not passed by compiler for Debug builds
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • Setting background image for body element in xhtml (for different monitors and resolutions)
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • Authorize attributes not working in MVC 4
  • How can I remove ASP.NET Designer.cs files?
  • JaxB to read class hierarchy
  • Busy indicator not showing up in wpf window [duplicate]
  • Converting MP3 duration time
  • Python/Django TangoWithDjango Models and Databases
  • Net Present Value in Excel for Grouped Recurring CF