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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:36:24+00:00 2026-05-23T08:36:24+00:00

Let me first stress the fact that I’m talking about the Mac OS X

  • 0

Let me first stress the fact that I’m talking about the Mac OS X SDK, not iPhone.

In order to determine the “connectivity” and get the flags, I do something similar to:

#import <SystemConfiguration/SystemConfiguration.h>
const char *hostName = [@"google.com" cStringUsingEncoding:NSASCIIStringEncoding];
SCNetworkReachabilityRef target = SCNetworkReachabilityCreateWithName(NULL, hostName);
SCNetworkConnectionFlags flags = 0;
SCNetworkReachabilityGetFlags(target, &flags);

Which is fine for just that — getting info on the reachability of Google (which is exactly what I want to know).

Is there a way to add an observer to the changes? I’ve been looking into SCDynamicStore, but I find the single example from Apple and the documentation a bit overwhelming.

Ideally I’d want to be able to set a function for flag changes, but this will suffice: notice when IP is “dropped”/released, and when it is obtained. (I could then do the reachability hardcoded in the function which is triggered on IP obtained).

Please don’t hesitate to ask for elaborations.

  • 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-23T08:36:24+00:00Added an answer on May 23, 2026 at 8:36 am

    Yes, you can use SCNetworkReachabilitySetCallback and SCNetworkReachabilityScheduleWithRunLoop. You don’t need to use SCDynamicStore unless you want to specifically watch a particular network interface.

    If you want to take a look at a complete example, you can see what I did for NCIDpop (a network caller ID displayer). Search for SCNetworkReachability in this file. The comments in the networkReachabilityCallback function give you some idea of what state transitions to expect (which weren’t terribly well documented when I wrote that code).

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

Sidebar

Related Questions

I'm writing a program for iPhone that will first let the user take a
Let me first clarify that I'm not much familiar with PHP language, since I
Let me first state that I know next to nothing about LDAP and this
Let me first say that I realize this question is vague and does not
First let me say that I really feel directionless on this question. I am
First let me state that, despite being a fairly new practitioner of TDD, I'm
First let me say that I did see this article: How to remove AspxAutoDetectCookieSupport
First let me explain. I have several addresses on the page that I put
let me first off noting that I have absolutely no idea what I'm doing
First let me explain that I've created a million lib directories scouring out all

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.