i am new to iphone in my app i am connecting to database through web services it working correctly,but i want to displat alert when network connection is disable.please any help me how to alert when net connection is disable, thanks in advance.
Asked
Active
Viewed 354 times
3 Answers
1
Have a look at this S.O. entry
In particular, the main point of interest for you is the first one, about using the Reachability framework to detect network connectivity.
0
When you get notified by your delegate/Observer for the network disable state, you could show message in UIAlertView
.
//show an alert to let the user know that they can't connect...
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Network Status" message:@"Network is not available. Please try again later." delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
[alert show];
[alert release];
you could also use the Reachability API's to know the state of network connection.

Jhaliya - Praveen Sharma
- 31,697
- 9
- 72
- 76