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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:43:07+00:00 2026-05-26T03:43:07+00:00

Once an array is properly filled, when I call it again using tableview reload,

  • 0

Once an array is properly filled, when I call it again using tableview reload, first time (after clean) returns an empty value and following executions returns EXC_BAD_ACCES. Trying to provide all code needed… Thanks for help!

in .h file:

    @interface userViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {

        NSArray *appData;

        IBOutlet UIActivityIndicatorView *activityIndicator;
        IBOutlet UILabel *status;
        IBOutlet UITableView *mainTable;
        IBOutlet UIBarButtonItem *refresh; 
    }

    @property (nonatomic, retain) UIActivityIndicatorView *activityIndicator;
    @property (nonatomic, retain) UILabel *status;
    @property (nonatomic, retain) UITableView *mainTable;
    @property (nonatomic, retain) UIBarButtonItem *refresh;
    @property (nonatomic, retain) NSArray *appData;

- (IBAction) refresca: (id)sender;

in .m file, when requestFinished function is executed, appData is properly filled.

- (void)requestFinished:(ASIHTTPRequest *)request {
    NSLog(@"%@", [request responseString]);
    [activityIndicator stopAnimating];
    activityIndicator.hidden = YES;

    appData = [[request responseString] componentsSeparatedByString: @"#"]; 

    int x =0;

    while (x<[appData count] - 1)
    {
        NSLog(@"Data = %@",[appData objectAtIndex: x]);
        x = x+1;
    }

}

However, after its execution, when reload tableview, appData seems that is empty and previous conted erased!!

2011-10-13 18:10:43.682 Nimbo[444:207] Data = <UITableViewCellContentView: 0x5c93dd0; frame = (0 0; 320 43); layer = <CALayer: 0x5c953b0>

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

        [tableView setFrame:CGRectMake(0, 44, 320, 412)];

        static NSString* cellIdentifier = @"cellIdentifier";
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];

        if(cell == nil)
        {
            cell = (UITableViewCell*) [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];

        }
        cell.accessoryType = UITableViewCellAccessoryNone;
        cell.textLabel.backgroundColor = [UIColor clearColor];


        int x = 0;

        if ([appData count] != 0)
           {
           NSLog(@"Data = %@",[appData objectAtIndex: 0]);
            }

        return cell;
    }
  • 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-26T03:43:08+00:00Added an answer on May 26, 2026 at 3:43 am

    Looks like your instance variable appData is not retained.

    EDIT: as others have said, using the property is the best way to go. That will retain your new appData as well as release objects previously assigned there.

    Try changing:

        appData = [[request responseString] componentsSeparatedByString: @"#"]; 
    

    to:

        self.appData = [[request responseString] componentsSeparatedByString: @"#"]; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array of checkboxes that I edit at once to set up
If I iterate through an array twice, once by reference and then by value,
This is what I have: $observer = $this->getMock('SomeObserverClass', array('method')); $observer->expects($this->once()) ->method('method') ->with($this->equalTo($arg1)); But the
Once again one of those: Is there an easier built-in way of doing things
Once again a very beginner-ish question, but here I go: I would like to
I archive an array (NSMutableArray) of custom objects that implement the . Once i
Once I've created a variable in the immediate window in C# (VS2008), is there
Once a user starts a session (or logs in, for a registered user, to
Once I have all the files I require in a particular folder, I would
Once a programmer decides to implement IXmlSerializable , what are the rules and best

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.