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 5996031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:02:41+00:00 2026-05-23T00:02:41+00:00

I am trying to get the network status via the following code //define in

  • 0

I am trying to get the network status via the following code

//define in my .h file
NetworkStatus internetConnectionStatus;

//define in my .m file
self.internetConnectionStatus = [[Reachability reachabilityForInternetConnection]currentReachabilityStatus];

I am getting self.internetconnection status = <null>. What am I doing wrong here?

  • 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-05-23T00:02:42+00:00Added an answer on May 23, 2026 at 12:02 am

    You should compare the value of it to the enum values defined in Reachability.h:

    if(self.internetConnectionStatus == NotReachable)
    {
        // no connection
    } else if(self.internetConnectionStatus == ReachableViaWiFi)
    {
        // WiFi connection
    } else if(self.internetConnectionStatus == ReachableViaWWAN)
    {
        // 3G connection
    }
    

    Also, make sure your NetworkStatus has an @property (nonatomic, assign) for it in your header if you’re using self. to get/set it.

    In my opinion though, assuming you’re using the Apple Reachability sample, it’s not particularly refined and could possibly be giving an erroneous value in some circumstances. For a more robust version, use either the version that ships with the ASIHTTPRequest library, or the version which it is based on, which is available for download here and detailed in this blog post.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying get values from a GridView using the following code: foreach (GridViewRow row
I'm trying to get the label of some network resources mapped as drives. When
I am trying to get a list of local network computers. I tried to
I've got a Sony network camera (SNC-RZ25N) that I am trying desperately to get
Trying to get comfortable with jQuery and I have encountered some sample code that
Hi am trying get GPS using network provider and GPS provider. but am getting
Trying to get this query to work in MS Access. Update Network.Location=Enclave.Location Where Enclave.Site=No
I'm trying to get the MAC address for the network adapter of the user's
I'm trying to get a list of the available cellular network providers. Unfortunately I
I'm trying to access out-of-network profiles using the LinkedIn API, following the instructions from

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.