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

  • SEARCH
  • Home
  • 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 8026743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:35:25+00:00 2026-06-04T23:35:25+00:00

I cannot seem to figure out what to do to resolve this error that

  • 0

I cannot seem to figure out what to do to resolve this error that I am receiving. I click on a cell which pops a new UITableViewController onto the stack. Once I hit the back button on the Navigation UI when in this controller I receive this error in the debugger but there doesn’t seem to be any issue with the app as it doesn’t crash or hang and still works fine.

An instance 0x79a8400 of class UITableView was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attached to some other object. Set a breakpoint on NSKVODeallocateBreak to stop here in the debugger. Here’s the current observation info:
(
Context: 0x0, Property: 0x738c010>
)

Code is below and I am using similar code on other UITableViewControllers but not receiving the error.

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) 
    {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
// Do any additional setup after loading the view.
    pull = [[PullToRefreshView alloc] initWithScrollView:(UIScrollView *) self.tableView];
    [pull setDelegate:self];
    [self.tableView addSubview:pull];
    [tableView.dataSource self];
    [tableView.delegate self];

    NSString *isAuthenticated = [[NSString alloc] init];
    isAuthenticated = [self retrieveUserToken:[[NSUserDefaults standardUserDefaults] valueForKey:@"email"]];
    NSNumber *categorySelected = [[NSNumber alloc] init];
    categorySelected = [[NSUserDefaults standardUserDefaults] valueForKey:@"category_id"];
    if (![isAuthenticated length])
    {
         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Message" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];
         [alert show];
         return;
    }else if (categorySelected ==nil) 
    {
         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"alert" message:@"message" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];
         [alert show];
         return;
    }

         [self getTableViewData];
    }

 - (void)viewDidUnload
 {
     [self setTableView:nil];
     pull = nil;
     [super viewDidUnload];
     // Release any retained subviews of the main view.
 }

 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
 {
     return (interfaceOrientation == UIInterfaceOrientationPortrait);
 }

 - (NSString *)retrieveUserToken:(NSString *)user
 {
     NSError *error = nil;
     NSString *username = user;
     return [SFHFKeychainUtils getPasswordForUsername:username  andServiceName:@"app" error:&error];
 }

 - (void)getTableViewData 
 {
     URLSingleton *urls = [[URLSingleton alloc] init];
     responseData = [NSMutableData data];
     NSNumber *categoryID = [[NSNumber alloc] init];
     categoryID = [[NSUserDefaults standardUserDefaults] valueForKey:@"category_id"];

     NSString *urlComplete = [[NSString alloc] init];
     urlComplete = [urls getEvent:categoryID];
     NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlComplete]];
     NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
     [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
     [connection start];
 }

 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
 {
     return categories.count;
 }  

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
 {

     UITableViewCell *cell = [[UITableViewCell alloc]
                         initWithStyle:UITableViewCellStyleDefault
                         reuseIdentifier:@"cell"];

     cell.textLabel.textColor = [UIColor blackColor];
     cell.textLabel.text = [categories objectAtIndex:indexPath.row];
     return cell;
 }

 - (void)viewWillAppear:(BOOL)animated 
 {
     [super viewWillAppear:animated];
     [self.tableView reloadData]; 
 }

 - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
 {
     [responseData setLength:0];
 }

 - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
     [responseData appendData:data];
 }

 - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
 {
     UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Message." delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];
     [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
     [pull finishedLoading];
     [alert show];
 }

 - (void)connectionDidFinishLoading:(NSURLConnection *)connection
 {
     NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];

     NSDictionary *dictionary = [responseString JSONValue];
     NSArray *response = [dictionary valueForKey:@"name"];
     NSArray *responseID = [dictionary valueForKey:@"id"];

     categories = [[NSMutableArray alloc] initWithArray:response];
     eventID = [[NSMutableArray alloc] initWithArray:responseID];
     [self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
     [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
     [pull finishedLoading];
 } 

 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
 {

     UITableViewCell *selectedCell = [self.tableView cellForRowAtIndexPath:indexPath];
     NSString *cellText = selectedCell.textLabel.text;
     int i = 0;
     for(NSString *name in categories)
     {
         if ([name isEqualToString:cellText]) 
         {
             [[NSUserDefaults standardUserDefaults] setValue:[eventID objectAtIndex:i] forKey:@"event_id"];
             [[NSUserDefaults standardUserDefaults] setValue:cellText forKey:@"event_name"];
             [[NSUserDefaults standardUserDefaults] synchronize];
         }
         i++;
     }

     [self.tableView deselectRowAtIndexPath:indexPath animated:YES];

     if(checkedIndexPath) {
         UITableViewCell* uncheckCell = [self.tableView
                                    cellForRowAtIndexPath:checkedIndexPath];
         uncheckCell.accessoryType = UITableViewCellAccessoryNone;
     }
      UITableViewCell* cell = [self.tableView cellForRowAtIndexPath:indexPath];
      cell.accessoryType = UITableViewCellAccessoryCheckmark;
      checkedIndexPath = indexPath;
  }

 -(void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath
 {

 }

 - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 
 {

     URLSingleton *urls = [URLSingleton sharedInstance];
     NSNumber *event = [[NSNumber alloc] init];
     if(editingStyle == UITableViewCellEditingStyleDelete)
     {  
         UITableViewCell *selectedCell = [self.tableView cellForRowAtIndexPath:indexPath];
         NSString *cellText = selectedCell.textLabel.text;
         int i = 0;
         for(NSString *name in categories)
         {
             if ([name isEqualToString:cellText]) 
             {
                 event = [eventID objectAtIndex:i];
                 [eventID removeObjectAtIndex:i];
             }
             i++;
         }

         NSString *reqURL = [[NSString alloc] initWithString:[urls deleteEvent:[event stringValue]]];
         NSURLRequest *delReq = [NSURLRequest requestWithURL:[NSURL URLWithString:reqURL]]; 
         NSURLResponse *resp = nil;
         NSError *err = nil; 
         NSData *response = [NSURLConnection sendSynchronousRequest:delReq returningResponse: &resp error: &err];
         NSString *reply = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];

         SBJsonParser *parser = [SBJsonParser new];
         id content = [reply JSONValue];
         if(!content){
              NSLog(@"%@", parser.errorTrace);
             [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
             return;
         }
         NSNumber *status = [content valueForKey:@"success"];
         NSNumber *one = [[NSNumber alloc] initWithInt:1];
         if ([status isEqualToNumber:one])
         {
              [categories removeObjectAtIndex:indexPath.row];
              [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
         }else 
         {
             UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Message" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];
             [alert show];
         }

     }
 }

 - (void)pullToRefreshViewShouldRefresh:(PullToRefreshView *)view;
 {
     NSString *isAuthenticated = [[NSString alloc] init];
     isAuthenticated = [self retrieveUserToken:[[NSUserDefaults standardUserDefaults] valueForKey:@"email"]];
     NSNumber *categorySelected = [[NSNumber alloc] init];
     categorySelected = [[NSUserDefaults standardUserDefaults] valueForKey:@"category_id"];
     if (![isAuthenticated length])
     {
         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Message" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];
         [alert show];
         return;
     }else if (categorySelected ==nil) 
     {
          UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Message" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];
         [alert show];
         return;
     }
      [self getTableViewData];
 }

 - (IBAction)createEvent:(id)sender 
 {
     NSString *isAuthenticated = [[NSString alloc] init];
     isAuthenticated = [self retrieveUserToken:[[NSUserDefaults standardUserDefaults] valueForKey:@"email"]];
     NSNumber *categorySelected = [[NSNumber alloc] init];
     categorySelected = [[NSUserDefaults standardUserDefaults] valueForKey:@"category_id"];
     if (![isAuthenticated length])
     {
          UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Message" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];
         [alert show];
         return;
     }else if (categorySelected == nil) 
     {
         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Alert" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];
         [alert show];
         return;
     }
     AddEventViewController *aevc = [self.storyboard instantiateViewControllerWithIdentifier:@"AddEventViewController"];
     [self.navigationController popToViewController:aevc animated:YES];
 }
  • 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-04T23:35:27+00:00Added an answer on June 4, 2026 at 11:35 pm

    I fixed it by adding the following method

    - (void)dealloc
    { 
        [self.tableView removeObserver:pull forKeyPath:@"contentOffset"];
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a syntax error in this subquery that I cannot seem to figure
I cannot seem to figure out I am getting the following error in IE
I just cannot seem to figure this out. I need another set of eyes.
I cannot seem to figure out where I went wrong with this. favorite share
...which I cannot seem to figure out, for whatever reason. I've tried cleaning my
I am new to ExtJS and cannot seem to figure out how to group
I have a particular need which I cannot seem to figure out. I've done
I cannot seem to figure out what is making this script go wrong... You
Looking over the magento 1.5 schema I cannot seem to figure out how a
I cannot seem to figure out how to do a Selection Alignment in the

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.