开发者

Network Connection Warning

开发者 https://www.devze.com 2023-02-02 04:48 出处:网络
The Tweetie (now Twitter) app has a pop up Network Reachability warning. This also done in the Foursquare and Hashable apps (as far as I know). Is there example code of this implementa开发者_StackOver

The Tweetie (now Twitter) app has a pop up Network Reachability warning. This also done in the Foursquare and Hashable apps (as far as I know). Is there example code of this implementa开发者_StackOverflowtion somewhere? Thanks.

Network Connection Warning


The apple recommended way is decently documented here (a bit old): http://www.raddonline.com/blogs/geek-journal/iphone-sdk-testing-network-reachability/

The AllSeeingInteractive ASIHTTPrequest library integrates an extended version of this by Andrew Donoho as a drop-in replacement for Apple’s Reachability class. It allows ASIHTTPRequest to be notified when the network connection changes from WWAN to WiFi, or vice-versa. It uses an NSNotificationCenter observer to watch for network connectivity changes.

ASIHTTPRequest is available from github at http://github.com/pokeb/asi-http-request/tree, the doucmentation is at http://allseeing-i.com/ASIHTTPRequest/

The request library is worth a look in as well, if you need one - I use it in all my iOS / Mac projects that call out to the Internet.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号