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 6044203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:59:07+00:00 2026-05-23T06:59:07+00:00

I cant refresh tableView it is crashing without any exception.i am placing my code

  • 0

I cant refresh tableView it is crashing without any exception.i am placing my code below.please let me know where i have gone wrong..

    -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        return 103;
    }

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
    {
        if(indexPath.row==[self.NewsArray count])
        {
            MoreLoadingViewCell *cell = (MoreLoadingViewCell *)[tableView dequeueReusableCellWithIdentifier:@"MyCell"];
            if(cell==nil)
            {
                [[NSBundle mainBundle] loadNibNamed:@"MoreLoadingViewCell" owner:self options:nil];
                cell = moreViewCell;
                cell.selectionStyle = UITableViewCellSelectionStyleNone;
                //cell.backgroundView=nil;
            }
            return cell;
        }
        else
        {
            NewsCell *newsCell = (NewsCell *)[tableView dequeueReusableCellWithIdentifier:@"NewsCell"];
            if (newsCell == nil) 
            {
                NSLog(@"create adcell object");
                [[NSBundle mainBundle] loadNibNamed:@"NewsCell" owner:self options:nil];
                newsCell=newsCellobject;

            }

            NewsObjectClass *object;
            object=[self.NewsArray objectAtIndex:indexPath.row];
            NSString *title=[object valueForKey:@"title"];
            NSString *description=[object valueForKey:@"Description"];
            NSString *dateString=[object valueForKey:@"NewsDate"];
            newsCell.secondLabel.text=title;
            newsCell.thirdLabel.text=description;
            NSDateFormatter *dateFormatter=[[NSDateFormatter alloc]init];
            [dateFormatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
            NSDate  *date=[dateFormatter dateFromString:dateString];
            [dateFormatter setDateFormat:@"YYYY MMM,dd hh:mm a"];

            NSString *date_new=[dateFormatter stringFromDate:date];
            NSLog(@"date is------ %@",date_new);

            newsCell.DateLabel.text=date_new;

            return newsCell;

        }

    }


    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
        return 1;
    }

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
    {
        NSLog(@"-----------------array count is----------------------- %d",[self.NewsArray count]);
        if ([self.NewsArray count] == 0) 
        {
            return 0;
        }
        return [self.NewsArray count]+1;

    }

    - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
    {

        if(refreshing)
        {
            NSLog(@"I am a big BUG, hehe hahahaha");
            [spinner startAnimating];
            [self performSelector:@selector(getDetails:) withObject:@"0" afterDelay:1.0];
            //self.refreshing=NO;
        }


    }

    - (void) scrollViewDidScroll:(UIScrollView *)scrollView{


        tempView.frame = CGRectMake(0,-80 - scrollView.contentOffset.y , 320,80);   
        if(scrollView.contentOffset.y < -60)
        {       
            lbl.text = @"Release to Update";
        }
        else
        {
            lbl.text = @"Pull down to Update";
        }

    }

    - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
    {

        if(scrollView.contentOffset.y<-60 && !refreshing)
        {
            refreshing=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-05-23T06:59:07+00:00Added an answer on May 23, 2026 at 6:59 am

    Post your crash log, Did you tried to debug the code by placing break points? After a quick review of your code I noticed that you are not releasing the NSDateFormatter *dateFormatter initialized inside the – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath method. This ll result in a huge memory leak. Also NSLog following variables to check whether they have expected values or nil.

    NSString *title=[object valueForKey:@"title"];
    NSString *description=[object valueForKey:@"Description"];
    NSString *dateString=[object valueForKey:@"NewsDate"];
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I cant post the code (proprietary issues) but does anyone know what types of
I cant figure out how to get lua to do any common timing tricks,
Why cant i use code nuggets to set a control property??For example a validationgroup
I cant figure out whats wrong. Its working when i tried to refresh only
Again a c# question I cant't seem to figure out: I have a datagridview
Any idea why i cant use or cant build in Lua the ProTeaAudio ?
simple question maybe but can't find solution. I have button for refresh/update some contents
I have been using this: http://blog.leahculver.com/2010/12/iphone-pull-to-refresh.html to make the pull to refresh function in
I have a button refresh which every time i click on it i want
Im trying to execute a refresh on a materialized view, but I cant get

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.