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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:51:18+00:00 2026-06-10T08:51:18+00:00

Update: Tidied up question and made it a bit clearer I am getting EXC_BAD_ACCESS

  • 0

Update: Tidied up question and made it a bit clearer

I am getting EXC_BAD_ACCESS crashes on a NSManagedObject.

I have a Sentence managed object that I pass to a modal view (addStoryItem) like so:

addStoryItem.sentence = (Sentence*)[fetchedResultsController objectAtIndexPath:indexPath];

AddStoryItem is set to retain Sentence:

@property (retain) Sentence *sentence;

Sometimes the user needs to do something that shows another modal (on top of addStoryItem) – which doesn’t affect this object, but it does take a copy of a NSMutableSet – sentence.audiosets

If I they do view this modal I get an EXC_BAD_ACCESS whenever I try to access or set the sentence object or its properties, once the user is returned to addStoryItem

  • There is a current managed object context & fetched results controller
  • everything works fine unless I show that modal view controller (which, afaik, doesn’t have anything to do with the sentence object)
  • Zombies is on, but it doesn’t tell me anything (BRAINS?)

Here’s a simple summary of what goes on:

  • user selects row in tableview
  • I get object from table and set the modal’s sentence property then display the modal with the fetchedResultsController
  • I display a string, image and set a nsset from the sentence to ui aspects of the modal
  • if the user needs to modify the nsset they display another modal, with a copy of the first nsset (which doesn’t change or access the sentence object)
  • if I try to set a property in the sentence after closing the 2nd modal (or NSLOG sentence) – EXC_BAD_ACCESS.

As far as I’m concerned I own sentence. Other properties of addStoryItem are still hanging around in memory – but sentence isn’t there when I try to get to it. Yes, I release sentence in addStoryItem’s dealloc – but that’s not being called (I have a log statement in there).

Can you help? Happy to provide more code or info. Pretty frustrated!

  • 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-10T08:51:20+00:00Added an answer on June 10, 2026 at 8:51 am

    You are creating a new sentenceToUpDate in your didSelectRowAtIndexPath:. Surely, this reference will be forgotten as soon as you are out of that method.

    Rather, you should assign the retrieved object to your retained property, like this:

    self.sentence = [fetchedResultsController objectAtIndexPath:indexPath];
    

    Now the instance should be retained as expected.

    Another possible culprit is your copy of the NSSet. Try creating a new NSSet to make sure you are not effecting the entity:

    NSSet *setToBePassedToModal = [[NSSet alloc] 
                                    initWithSet:entity.toManyRelationship];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATE 6/21/12 I have a form in rails that is working similar to an
Update 2018 TL;DR; LaTEX for WPF https://github.com/ForNeVeR/wpf-math Original question I need to have a
Update I want to have an expression (XPath, or Regex Expression, similar) that can
UPDATE: I made a mistake in my debugging - this question is not relavent
*update: sorry for the vagueness. I have updated the question I am using the
UPDATE UPI_ATTRIBUTE SET SITE_INC ='0' WHERE USER_PROFILING_NAME IN ('CAR_IMPLICIT','CAR_EXPLICIT') Above is my query that
Update : I found almost exact similar question , yet it has slightly different
UPDATE: I'm getting this error: (No route matches /docs/index.html... ) when accessing admin.example.com/docs/index.html The
UPDATE: I've completely changed the question because in reality, I'm having a really hard
UPDATE This is an old question for an old version of Xcode. It turned

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.