Reachability

Discussion in 'iOS Development' started by hackpro1989, Oct 16, 2009.

  1. hackpro1989

    hackpro1989 Member

    Joined:
    Mar 8, 2008
    Messages:
    96
    Likes Received:
    0
    Device:
    iPhone 4S (White)
    my app was declined for
    It would be appropriate to display either a notification or an alert stating that internet connectivity is required.

    I added Reachability But i wont work can some please help me with this issue
  2. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    What do you mean you added reachability? Just the framework? You need to use the framework..
  3. hackpro1989

    hackpro1989 Member

    Joined:
    Mar 8, 2008
    Messages:
    96
    Likes Received:
    0
    Device:
    iPhone 4S (White)
    The Code is there and the Framework is there as well it just will not put the alert out
  4. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    Are you calling the method? Displaying the alert properly? Is the code even correct? NSLog(); is a good place to start.
  5. Collateral

    Collateral Active Member

    Joined:
    Sep 23, 2007
    Messages:
    1,974
    Likes Received:
    6
    Device:
    iPhone 3GS (Black)
    This is from google... it seems right?

    [OBJC]-(void) connection

    Please Register or Log in to view images

    NSURLConnection *)connection
    didFailWithError: (NSError *)error {
    UIAlertView *errorAlert = [[UIAlertView alloc]
    initWithTitle: [error localizedDescription]
    message: [error localizedFailureReason]
    delegate:nil
    cancelButtonTitle

    Please Register or Log in to view images

    "OK"
    otherButtonTitles:nil];
    [errorAlert show];
    [errorAlert release];
    [activityIndicator stopAnimating];
    NSLog (@"Connection Failed with Error");
    }[/OBJC]
  6. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    That only gets called when a NSURLConnection fails to connect, i believe.
  7. Collateral

    Collateral Active Member

    Joined:
    Sep 23, 2007
    Messages:
    1,974
    Likes Received:
    6
    Device:
    iPhone 3GS (Black)
    Yea, and if you cant connect to a URL (which is what NSURLConnection does, i'm assuming), then you can safely assume you have no network connection, and display a UIAlertView?

Share This Page