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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:11:35+00:00 2026-05-20T15:11:35+00:00

i build an app to send OSC-Messages through WLAN. Thats why i have a

  • 0

i build an app to send OSC-Messages through WLAN.
Thats why i have a “Network” entity with a single object in it. Cause of this, i want a Singleton to fetch this object.
In AppDelegate i created a Classmethod to get the ManagedObjectContext

static NSManagedObjectContext* manObCon;

@implementation...

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  
   manObCon = self.managedObjectContext;
...
}

+ (NSManagedObjectContext*) getManObCon{
   return manObCon;
}

the managedObjectContext arrives with an address in my singleton, so i think it should work.
Singleton.h (nothing special here)

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import "OSC_iPadAppDelegate.h";
#import "Network.h";

@interface NetworkSingleton : NSObject <NSFetchedResultsControllerDelegate> {
}
+ (Network*) getNetwork;
+ (void) insertNewObject;
+ (NSFetchedResultsController *)fetchedResultsController;
@end

Singleton.m APP CRASHES AT [fetchedResultsController_ performFetch:&error] with

warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/info/dns.so (file not found).
Program received signal:  “EXC_BAD_ACCESS”.
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
kill
quit

Heres the Code of Singleton.m

#import "NetworkSingleton.h"
static Network* _network;
static NSFetchedResultsController *fetchedResultsController_;
static NSManagedObjectContext *managedObjectContext_;

@implementation NetworkSingleton

+ (Network*) getNetwork{
    managedObjectContext_ = [OSC_iPadAppDelegate getManObCon]; //get the managedObjectContex from AppDelegate
//fetchedResultsController init
    fetchedResultsController_ = [NetworkSingleton fetchedResultsController]; //get fetchedResultsController 
//check if _network is set
    if (_network == nil) {
        id <NSFetchedResultsSectionInfo> sectionInfo = [[fetchedResultsController_ sections] objectAtIndex:0];
//if not set, check if there is already an network object in coredata
        if ([sectionInfo numberOfObjects] == 0) {
            //Create new Networkobject, if no one is existing
            [NetworkSingleton insertNewObject];
            fetchedResultsController_ = nil;
        }
//set _network
        _network = [fetchedResultsController_ objectAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
    }
    return _network;
}

+ (NSFetchedResultsController *)fetchedResultsController {

    if (fetchedResultsController_ != nil) {
        return fetchedResultsController_;
    }

    NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
    NSEntityDescription *entity = [NSEntityDescription entityForName:@"Network" inManagedObjectContext: managedObjectContext_];
    [fetchRequest setEntity:entity];

    [fetchRequest setFetchBatchSize:1];

    NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"sourcePort" ascending:YES selector:nil];
    NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];

    [fetchRequest setSortDescriptors:sortDescriptors];

    NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:managedObjectContext_ sectionNameKeyPath:nil cacheName:nil];
    aFetchedResultsController.delegate = self;
    fetchedResultsController_ = aFetchedResultsController;

    [aFetchedResultsController release];
    [fetchRequest release];
    [sortDescriptor release];
    [sortDescriptors release];

    NSError *error = nil;
    /*
     APP CRASHES HER
     */
    if (![fetchedResultsController_ performFetch:&error]) { 
        NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
        abort();
    }

    return fetchedResultsController_;
}    
@end

So i dont know why the fetchedResultsController_ doesn’t what he does best – fetch
it isn’t nil but i can’t understand the Errormessage and found nothing ob Google or somewhere else.
The problem could be, that i need to init the fetchedResultsController by myself, because it doesn’t init automatically like in generated view controllers.

Thanks for your Help

  • 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-20T15:11:35+00:00Added an answer on May 20, 2026 at 3:11 pm
    NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:managedObjectContext_ sectionNameKeyPath:nil cacheName:nil];
    
    fetchedResultsController_ = aFetchedResultsController;
    
    [aFetchedResultsController release];
    

    When you use fetchedResultsController_ after this block of code it is released already. Because you allocated it (retainCount+1) and then you released it (retainCount-1). You didn’t retain when you assigned aFetchedResultsController to fetchedResultsController_.

    either retain it like this fetchedResultsController_ = [aFetchedResultsController retain];
    or remove the line [aFetchedResultsController release];


    EDIT: I just saw that there might be more wrong in your code.

    You should replace all fetchedResultsController_ outside of the fetchedResultsController getter with self.fetchedResultsController. Normally the _ behind or in front of a variable should tell you that you should use the setter and getter unless you are sure what you are doing.

    And fetchedResultsController_ = [NetworkSingleton fetchedResultsController]; invokes fetchedResultsController_ = aFetchedResultsController;.
    Which might work, but I wouldn’t do it.

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

Sidebar

Related Questions

I have developed an ipad app and want to send this build to the
I need to build app with user messages (dialogs). I've solved this problem by
I have used the signalR chat app (as laid out in this tutorial http://sergiotapia.com/2011/09/signalr-with-mvc3-chat-app-build-asynchronous-real-time-persistant-connection-websites/
Does anybody have experience build app with PhoneGap's Build Service? I followed the steps
I want to build a simple web-interface application that can send/receive chat messages to/from
I have a desktop client application build under .net 4.0 and WPF. In this
I have build my app with and ad hoc provisioning profile/distribution certificate pair following
I am trying to build an app in the rails way, so this time
I need to build an app such as Messages in iPhone, but easier (don't
Is it possible to build an Ad Hoc build of our app and send

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.