Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9168805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:43:11+00:00 2026-06-17T15:43:11+00:00

I have Reachability class that I adopted from Apple. My problem is implementing my

  • 0

I have Reachability class that I adopted from Apple. My problem is implementing my reachability detection in my ListViewController rather than in the ReachabilityAppDelegate shown in Apple. My problems:

  1. I want to link the calling method in the (UITableViewCell *)tableView:(UITableView
    *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath and the reachability detection

  2. I am trying to disable my cell if they detect it is not connected and enable the cell if it
    is connected

This is coded in viewDidLoad:

   [[NSNotificationCenter defaultCenter] addObserver: self selector:@selector(reachabilityChanged:) name:kReachabilityChangedNotification object: nil];

The reachabilityChanged as below:

-(void) reachabilityChanged: (NSNotification* )note{
  Reachability* curReach = [note object];
  NSParameterAssert([curReach isKindOfClass:[Reachability class]]);
  [self updateInterfaceWithReachability: curReach];
}

How do I implement my disabling of UITableViewCells in

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
  • Take note that I have coded this in the above method:

    NSInteger row = [indexPath row];
        NSString *contentForThisRow = nil;
    
        static NSString *MyIdentifier = @"MyIdentifier";
    
        if (tableView == [[self searchDisplayController] searchResultsTableView]) {
            // Sort search results in alphabetical order
            NSArray *sorted = [searchResults sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
            contentForThisRow = [sorted objectAtIndex:row];
        }else {
            contentForThisRow = [nameArray objectAtIndex:row];
        }
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
    
            if (cell == nil) {
                cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier]autorelease];
            }
            // Set Device names into Cells
            cell.textLabel.text = contentForThisRow;
            cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    NSLog(@"Load cell done");
    

    }

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:43:12+00:00Added an answer on June 17, 2026 at 3:43 pm

    you can code like this , add an instance var BOOL _isOffline
    in the class and in your updateInterfaceWithReachability: method

    - (void)updateInterfaceWithReachability:(Reachability* )curReach
    {
        if(curReach == XXXXNotReachable)
        {
            //your code
            _isOffline = YES;
        }
        else
        {
            _isOffline = NO;
        }
        [_tableView reloadData];
    }
    

    in your -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

    you should add your code to deal with the cell , may be

    if(_isOffline)
    {
        cell.userInteractionEnabled = NO;
    }
    else
    {
        cell.userInteractionEnabled = YES;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a classic Apple reachability class which is not adapted to ARC. It
I have a class that reads configuration. Now the problem is that I don't
Apple has created that famous Reachability class but looking at the code I don't
I have a class that extends Overlay and implemments Overlay.Snappable. I have overriden its
var classFind= $('.frame').parent().parent().parent().parent().parent(); if (classfind.hasClass(.class)) { return true; } I have a class that
I have a very peculiar problem. I understand that while in the foreground the
I have been working on Reachability class for a while and have tried both
I have finally figured out how to use the apple Reachability files, which is
I have a C# 4.0 application that is referencing a type library from a
I have a method that I want to access from only one method because

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.