- ( NSString *)externalIPAddress { // see https://stackoverflow.com/questions/27708887/objective-c-how-to-get-the-public-ip-address-of-the-device/27709110#27709110 // http://myipdoc.com/ip.php NSString *publicIP = [ NSStringstringWithContentsOfURL :[ NSURLURLWithString : @"https://icanhazip.com/" ] encoding : NSUTF8StringEncodingerror : nil ]; publicIP = [publicIP stringByTrimmingCharactersInSet :[ NSCharacterSetnewlineCharacterSet ]]; return publicIP; }
iOS開發記錄,以及Java, Servlet, JavaScript, CSS, Html, Objective-c, Swift, NodeJS, ExpressJS, React Native, Python..etc