Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8873943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:35:45+00:00 2026-06-14T18:35:45+00:00

So I make alert view detects if there in a active internet connection. This

  • 0

So I make alert view detects if there in a active internet connection.

This is the Code:

- (void)viewDidLoad
{
    [super viewDidLoad];

    [[NSNotificationCenter defaultCenter] addObserver:self
    selector:@selector(reachabilityChanged:)
    name:kReachabilityChangedNotification
    object:nil];
    Reachability * reach = [Reachability reachabilityWithHostname:@"www.google.com"];
    reach.reachableBlock = ^(Reachability * reachability)
    { 
     dispatch_async(dispatch_get_main_queue(), ^{
     blockLabel.text = @"";  
     });
    };
    reach.unreachableBlock = ^(Reachability * reachability)
    {
     dispatch_async(dispatch_get_main_queue(), ^{
     blockLabel.text = @"You are not connected to the Internet";
     UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Please connect to Internet"
     message:nil
     delegate:self
     cancelButtonTitle:nil
     otherButtonTitles:nil];
     UIActivityIndicatorView *progress= [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(125, 50, 30, 30)];
     progress.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
            [alert addSubview:progress];
            [progress startAnimating];
            [alert show]; 
        });
    };
    [reach startNotifier];
    // Do any additional setup after loading the view, typically from a nib.
}

So my application detects if there is a internet connection. But the issue is that if I turn on internet on the iPhone and open the application it still saying there is not internet connection. What should I do…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:35:46+00:00Added an answer on June 14, 2026 at 6:35 pm

    Well i fix the issue by using notifications.. Code for Reference

    -(void)reachabilityChanged:(NSNotification*)note
    {
        Reachability * reach = [note object];
    
        if([reach isReachable])
        {
            notificationLabel.text = @"Notification Says Reachable";
            NSLog(@"Internet is Up");
        }
        else
        {
            notificationLabel.text = @"Notification Says Unreachable";
            NSLog(@"Internet is Down");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I make a class level method for Alert: @interface TestAlert @end + (void)showErrorAlert:(NSTimer *)message
jQuery.widget(ui.test, { _init: function(){ alert(this.element.innerHTML); } }); How do I make it so when
I'm trying to make a custom dialog to show a view in this dialog.
I am trying to make a custom login view popup like an alert view.
I would like to make a alert view every month (e.g. 1st of Every
in javascript, how to make alert bold n use h1 to h5 headers? Is
I tried to make an alert popup with A with: var a = \u0041;
I'm trying to make an alert show three seconds after the user touches a
I have to make below NSDictionary {aps:{sound:default, alert:{body:From Franklin Av To Grand Army Plaza03:56:30
I'm trying to make a notification area that will show alerts. return this.each(function() {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.