top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

HTTP MANAGER REACHABILITY in AFNetworking not working

+1 vote
596 views

I used HTTP MANAGER REACHABILITY to check internet availability as provided by AFNetworking document http://cocoadocs.org/docsets/AFNetworking/2.2.4/index.html

NSURL *baseURL = [NSURL URLWithString:@"http://example.com/"];
AFHTTPRequestOperationManager *manager = [[AFHTTPRequestOperationManager alloc] initWithBaseURL:baseURL];

NSOperationQueue *operationQueue = manager.operationQueue;
[manager.reachabilityManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
    switch (status) {
        case AFNetworkReachabilityStatusReachableViaWWAN:
        case AFNetworkReachabilityStatusReachableViaWiFi:
            [operationQueue setSuspended:NO];
            break;
        case AFNetworkReachabilityStatusNotReachable:
        default:
            [operationQueue setSuspended:YES];
            break;
    }
}];

but its not working.. i'm looking for your help.. Thanks

posted Jul 3, 2014 by Arun

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes
 
Best answer

You just need to inform AFHTTPRequestOperationManager to start monitor internet status.

    manager = [[AFHTTPRequestOperationManager alloc] initWithBaseURL:baseURL];
   [manager.reachabilityManager startMonitoring];
answer Jul 3, 2014 by Raju
Similar Questions
+1 vote

I want to check specified table contains value or its empty. I used number of complex method to find but no luck, any body can help me.

0 votes

I am developing my project which enables ARC feature but still some api am using is not having ARC featured code, So its throughs lot of error.

Here I need help from you to disable ARC for some class.

+1 vote

I am trying to get index path of cell when we make swipe.

I used below code to recognise cell swipe

in cellForRowAtIndexPath

UISwipeGestureRecognizer *cellRightSwipe = [[UISwipeGestureRecognizer alloc]initWithTarget:self   action:@selector(cellRightSwipeGeture:)];
    [cellRightSwipe setDirection:UISwipeGestureRecognizerDirectionRight];
    [cell addGestureRecognizer:cellRightSwipe];

and action for RightSwipe

-(void)cellRightSwipeGeture:(UISwipeGestureRecognizer *)gestureRecognizer {
NSIndexPath *indexPath ;
UITableViewCell *cell = [_subItemTbl cellForRowAtIndexPath:indexPath];}

Here i can't identify that which cell was i swiped .

0 votes

I don't want extra padding in top of uitableview in ios7.

help me to fix this.

0 votes

Here i want to know any simple way to check whether NSMutableArray contains specified object. I used for loop to find the object at index is same or not, but its get sucks processing because my array contains plenty of objects.

...