Search code examples
iosobjective-csingletonreachability

ReachabilityManager singleton class method not recognized


I'm trying to implement my ReachabilityManager singleton and check if the internet is reachable. Unfortunately when I attempt to call the class methods I get this error.

enter image description here

To go through the checklist:

1) I have imported both the reachability and my manager into the tableView I'm working on. enter image description here

2) I have implemented class methods in my singleton. enter image description here

3) I've also instantiated the manager in the appDelegate. enter image description here

So what am I missing?


Solution

  • isReachable is a class method and you are trying to call a class method from an object of this class by doing so

    [[InternetReachabilityManager sharedManager] isReachable] ; 
    

    in order for this to work you should call your class methods from the class itself without creating an object from the class like so :

    [InternetReachabilityManager isReachable] ;