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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:53:27+00:00 2026-05-20T00:53:27+00:00

I’m trying to create an app based on Apple’s example project TheElements, but using

  • 0

I’m trying to create an app based on Apple’s example project TheElements, but using Core Data for the model. In Core Data I have 4 related DB tables. In the UI I have several tableViews, each showing rows from a different Db table. Clicking a row in a tableView drills down to items in a related table, shown in another TableView.

Everything is working but the app crashes unexpectedly at random times with the error: Program received signal: “EXC_BAD_ACCESS”. BTW this error only shows in the console when debugging on the device. No error shows when debugging on the simulator. This screen grab shows the contents of the debugger after a crash.

I have no idea how to decipher the debugger. All I can see is the crash seems to stem from the main() function and _PFManagedObjectReferenceQueue is also listed, which leads to guess that I’m doing something wrong with Core Data.

To implement Core Data I’m adding the following to my App Delegate header:

@private  
    NSManagedObjectContext *managedObjectContext_;  
    NSManagedObjectModel *managedObjectModel_;  
    NSPersistentStoreCoordinator *persistentStoreCoordinator_;  

@property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext;  
@property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel;  
@property (nonatomic, retain, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator

and adding Apple’s default methods for these to App Delegate implementation file.

Then to my Data Source Protocol header I’ve added:

@property (nonatomic, retain) NSFetchedResultsController *fetchedResultsController;  
@property (nonatomic, retain) NSManagedObjectContext *managedObjectContext;`

and my Data Source header files are as follows:

#import <UIKit/UIKit.h>  
#import <CoreData/CoreData.h>  
#import "TableViewDataSourceProtocol.h"  

@interface MatchesAllDataSource : NSObject <UITableViewDataSource,TableViewDataSource, NSFetchedResultsControllerDelegate>  
{  
 NSFetchedResultsController *fetchedResultsController;  
 NSManagedObjectContext *managedObjectContext;  
}  

@end

When a table cell is clicked I pass the selectedObject as follows:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)newIndexPath  
{  
 // deselect the new row using animation  
    [tableView deselectRowAtIndexPath:newIndexPath animated:YES];  

 // get the element that is represented by the selected row.  
 Match *selectedMatch = [dataSource objectForIndexPath:newIndexPath];  

 // create an AtomicElementViewController. This controller will display the full size tile for the element  
 MatchViewController *matchController = [[MatchViewController alloc] init];  

 // set the element for the controller  
 matchController.selectedMatch = selectedMatch;  

 // push the element view controller onto the navigation stack to display it  
 [[self navigationController] pushViewController:matchController animated:YES];  
 [matchController release];  
}`

Does anyone have any idea what might be causing my crash?
Will someone please point me in the right direction to look for an answer?
Is there a better way to implement Core Data with multiple tableViews?
Will someone point me to a good example of Core Data with multiple tableViews?

  • 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-20T00:53:28+00:00Added an answer on May 20, 2026 at 12:53 am

    I had this problem too with Marcus’ code because I changed the UITableViewController to a regular UIViewController and forgot to put in the title. Here is his original code:

    - (id)initWithStyle:(UITableViewStyle)style {
    if (self = [super initWithStyle:style]) {
        self.title = @"Australia";
    }
    return self;
    

    }

    So if you happened to have changed things make sure that you are setting the self.title somewhere so the custom NSArray+PerformSelector can see it when the app is initializing… like in init.

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

Sidebar

Related Questions

No related questions found

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.