objective c - iPhone reachability checking -
I have found many examples of code to do what I want to do (check reaching), but in There is no one from me enough enough to use enough I do not understand why it does not want to play well.
I have access to the project I / I
# Import & amp; the lift; System Configuration / System Configuration & Gt;
And the structure has been added to me. I also have:
#import "reachability.h"
In .m I am trying to use accessibility.
Reachability * Accessibility = [Reachability Sharingability]; [Accessibility SetHostname: @ "http://www.google.com"]; // Set your host name here NetworkStatus remoteHostStatus = [Accessibility Remote Hoststats]; If (remotehoststats == notitable) {NSG (@ "no");} and if (remotehoststats == retinal veafinetwork) {NSLog (@ "WiFi"); } And if (Remote Hoststats == Retable VAACRRDN Network) {NSLog (@ "cell"); }
This is giving me all kinds of problems What am I doing wrong? I'm the perfect coder, I only have a hard time when it comes time to understand what I need to do, it needs to be enabled, whether I want to know what to do or not. (So disappointing)
Update: This is what is happening in my controller, in which I have
#import & lt; System configuration / system configuration is & gt; Set up with
and
#import "Reachability.h"
. This is my most favorite part of programming so far.
FWI, we have never implemented it in our code. Two features that require internet access (entering sweepstakes and buying a DVD) were not the main features, No need to use
Rather than adding more code, we set the background of both internet views to the notice of users that they To access the facility, connect to the Internet. It was concerning the interfaces of the rest of the application, and was well done / tastefully they did not say anything about it during the acceptance process, although we received a personal phone call to verify that we actually They were giving things related to the film. According to their usually unclear agreement, you are not allowed to not have sweepstakes otherwise.
I also think that it adheres to its strictly "use only those things that you need them completely".
With your screen shot it appears that you do not have to re-qualify For your project you must download rechargeability from the Apple:
And add both .h and .m files to your project.
Update: You noted that you have the ability to re-qualify, but looking at the most recent version, I can see why the errors you have listed - they have changed the API and you may have a sample code Which you will find elsewhere. Try:
In the .h file:
// Import rechargeable class #import "Reachability.h" // Announce Reachability, you no longer have a singleton But manage the installation Accessibility * Accessibility;
In the .m file:
[[NSNotificationCenter defaultCenter] addObserver: Self selector: @Selector (change network settings) Name: kReachabilityChangedNotification object: Zero] ; Accessibility = [Internet International Connection to Reach Accessibility]; [Accessibility StartNotifier]; NetworkStatus Remote Host Stats = [Accessibility Current Rehabilitation Stats]; If (Remote Host Stats == Notitable) {NSLog (@ "No");} and if (Remote Hoststats == Rechargeable Viva WiFi) {NSLog (@ "WiFi"); } And if (Remote Hoststats == Reserved Wevadan) {NSLog (@ "cell"); } ..... - (Zero) Change the Handle Network: (NSNextification *) Notice {NetworkStatus Remote HostStats = [Accessibility Current RebirthStatus]; If (Remote Host Stats == Notitable) {NSLog (@ "No");} and if (Remote Hoststats == Rechargeable Viva WiFi) {NSLog (@ "WiFi"); } And if (Remote Hoststats == Reserved Wevadan) {NSLog (@ "cell"); }}
Comments
Post a Comment