After inputting the Rechability classes Apple provided. Also after inputting this, Reachability reachabilityWithAddress:(const struct sockaddr_in *)hostAddress. How should we input the IP address we want to check into this line? This is the part where i'm really lost at.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- IPAddress.[Try]Parse parses 192.168 to 192.0.0.168
- how do you prevent page scroll in textarea on mobi
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- xcode 4 garbage collection removed?
- Xcode: Is there a way to change line spacing (UI L
- Unable to process app at this time due to a genera
- Popover segue to static cell UITableView causes co
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- didBeginContact:(SKPhysicsContact *)contact not in
Please try the following:
or to be more specific:
struct sockaddr_in
is a low-level "socket address" type used by BSD sockets. We generally don't deal with them at the Cocoa level, but they can creep up from time to time, including in Apple's demo class. The reason there is becauseSCNetworkReachability
uses astruct sockaddr_in
in one of its creation functions.Fortunately for you, however, you can supply a string instead with the
+reachabilityWithHostName:
method, and that includes IP addresses (which, like hostnames, will be resolved automatically for you by the underlying network APIs.)