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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:41:43+00:00 2026-05-23T23:41:43+00:00

I have a UITableView I’m populating with data from CoreData. I have a data

  • 0

I have a UITableView I’m populating with data from CoreData. I have a data access class I call a method on to get the array of data to populate the table with. In that method I have something like this:

NSArray *fetchedArray = [context executeFetchRequest:request error:&error];

I was just returning this array directly, but was getting an error in my view controller when I try to set its local property that holds the returned array

@property (nonatomic, retain) NSArray *listData;

and

@synthesize listData;  // <-- error here -[CFNumber release]: message sent to deallocated instance...

respectively.

It seemed like the ‘retain’ in my @property was trying to release the previous listData array, which seemed to have already been released (or, more likely an object in the array or one of its properties had been released).

So in my data access class I added the following after the fetchedArray is produced by the context:

NSMutableArray *listArray = [[[NSMutableArray alloc] init] autorelease];
for (Response *item in fetchedArray) {
    [listArray addObject:item];
}

return listArray;

But I still get the same error in the @synthesize listData back in the view controller. It doesn’t happen the first time usually, but after tapping through to the detail controller and then going back to the list and then reloading the list with different data (e.g. filtering based on user input which calls the data access method to return an updated list – hence the error in the setter for listData).

I’m not entirely sure if my problem is memory management related or related to something I’m not understanding about what the context returns. It’d be nice if a fetch request returned data that didn’t get released when I think I’ve retained it. 🙁

EDIT Note that given the answer, the title of the question may be a bit misleading.

  • 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-23T23:41:46+00:00Added an answer on May 23, 2026 at 11:41 pm

    Ah – just had to think it through a bit more. My problem was that I was assigning one of the objects in the array to a property on the detail controller, but calling release on that property in my detail controller’s dealloc.

    After changing @property (nonatomic, assign) to @property (nonatomic, retain) it doesn’t crash. Yay. Sooo looking forward to ARC.

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

Sidebar

Related Questions

I have a UITableView that uses JSON to to get new data from the
I have an array of objects which populate a UITableView . When a user
Hi i have UITableView with x rows and my cell data loaded with plist
I have a UITableView with the usual table view delegates. The problem is that
I have UITableView and I want to load more data when user tries to
I have a UITableView cell that is going to have a variable size depending
I have got an UITableView. How to simply fill it with three elements, for
I have a need to display a UITableView containing a user's account credentials. For
I have a UIView with a UITableView for a subview. The UIView has an
In an app I'm working on, I have a plain style UITableView that can

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.