core-data

App is crashing when deleting from UITableView due to self referencing connection.

Hi, I'm brand new to iPhone development (and first question posted here) and am sort of stuck with Core Data and Table Views. In short, my app is crashing when I delete a row from my UITableView due to NSFetchedResultsChangeUpdate being called on a record that has already been removed due to a cascade delete on a self referring table. ...

How to specify "Target" of Mogenerator generated files?

I have a xcode project with multiple targets (for logic and app unit tests). I am also using core data with the mogenerator plugin to autogenerate source files from the .xcdatamodel. The generate files are not being generated with any of the "target" flags selected. This causes build errors. Is anyone aware of a solution to this. I...

Is there a tool to look in core date binStore file on iPhone simulator ?

I would like to look at what is in my core data store when running on iPhone simulatore. I can see the file on my Mac but I don't know of any tool to read .binStore files. I am using binStore instead of SQLite because of core data query restrictions when using an SQLite backend. Other wise I would read it FireFox add-on. ...

sqlite to coredata

Can we map an sqlite file to coredata? ...

Can Core Data lazy-fetch a BLOB attribute on iOS?

I'm storing a photo as a Transformable attribute in my Core Data entity, which is a lot of data to load in an iPhone's memory. If I want to present a TableView that lists all of the entities (potentially hundreds or thousands), but only need to display their title, will Core Data still fetch each photo and store it in RAM before it's nee...

Code is extremely leaky.. I need help Identifying where the leaks are coming from.

My code works fine on my ipod, it's not slow and doesn't crash, but using Instruments I discovered 826 leaked blocks. The Header file is: #import "CountySelectionViewController.h" #import "iProspectLiteAnnotation.h" #import "iProspectLiteAnnotationView.h" #import <CoreLocation/CoreLocation.h> #import <iAd/iAd.h> #import <sqlite3.h> #imp...

"Dangling reference to an invalid object" error in Core Data with seemingly valid objects

I'm having a really confounding problem using Core Data. In my Core Data store, for an existing Core Data object, I'm checking whether a relationship exists, and if not, I create the object like so (this is a method on AFFingerprintGeneratorOperation): NSManagedObjectContext *newContext = [[NSManagedObjectContext alloc] init]; [newCont...

Core Data max storage iPhone

Is there a limit to how much persistent storage a single iPhone app may consume? What does save set the error argument to if the iPhone hits a per-app limit? What if it hits the hardware limit? Is it possible to limit the number of objects stored for certain entities? If so, what's a good approach to doing this? acani, an iPhone app I...

Updating/Deleting relationships using Core Data

I have the following relationship defined in Core Data Person --> Worked <-- Job I have a view that shows Person information in a tableview. The user can then click on Worked Items to see all worked items for that person (Worked entity shows hours worked and related job). I then push a view showing worked jobs for that person. I also s...

Core Data: avoiding retain cycles in to-many relationships

I'm still learning my way through iOS development and working with Core Data and have just come across retain cycles. It is my understanding from reading the Core Data Programming Guide that after you're done working with a relationship, you use the managed object context method refreshObject:mergeChanges to ensure that the retain cycle...

NSFetchedResultsController delegate methods not firing after mergeChangesFromContextDidSaveNotification

Hi, Been browsing through the posts similar to this one but none answered my problem. Like CoreDataBooks, I use a separate MOC for adding and editing items and observe the proper notifications, like so: - (void)addControllerContextDidSave:(NSNotification*)saveNotification { NSManagedObjectContext *context = [self.fetchedResultsCont...

Can't solve, "Can't merge models with two different entities named"

I'm working with a Core Data project in iOS 4.1 (targeting 3.1). When I add a Data Model version I get the dreaded "Can't merge models with two different entities named xxx" error." Cleaning Targets does not help. Deleting the build directory does not help. The only thing that solves the issue is deleting the previously installed version...

Books / Videos / Ressources to dive deep into Core Data?

My boss gave me the big mission to become an Core Data nerd. He wants me to spend at least 4 months fulltime on this topic, so that I can help with any problem that arises. Damn. Ok... I assume you have lots of great links for me! Let me suck them into my brain like a vacuum cleaner. Videos, Books, Ressources, etc... he gave me $500 bu...

Managing Recurring Events (Not EKEvents)

Hello everybody, I'm trying to create an iPhone app for helping me managing my class schedule. This means that I will have various subjects recurring regularly at a given time. So I might have one subject recurring every 2 days, whereas another is recurring every 3 weeks. I'm wondering now what the best way to storage this is, so that i...

iphone Core Data - Filtering NSFetchedResultController?

I was given a framework written by other programmers to access the core data. In this situation i receive a pre-loaded NSFetchedResultController which I need to filter, to display a part of it's data. Here is what I tried: NSPredicate *predicate = [NSPredicate predicateWithFormat:@"category==%@", @"current"]; [NSFetchedResultsControlle...

Add an existing xcdatamodeld "folder" to XCode

Does anyone know how to add an existing xcdatamodeld folder to an XCode project? xcdatamodeld is actually a folder, even though the OS recognizes it as a file, much like a [namehere].app folder. When I try to add the xcdatamodeld into XCode, all I get is a folder group with the name of the xcdatamodeld folder; that looks as it should (it...

UI Freezing when NSPredicate changes with Core Data

I've problem regarding to UI freezing when I pressed a button that try to change NSPredicate for Core Data fetch object it will hang for a while before it shows all of the data. This is especially when loading a tons of retrieve data. As other app that load a lot of processing by pressing a button. How do I should make the button tha...

How to save NSMutableArray of NSValue in CoreData?

I'm doing drawing app for ipad which need to save multiples of NSMutableArray of CGPoint (Converting into NSValue), suggest me for choosing coredata functions or any other approachs for saving more number of arrays ...

CoreData: multiple copies of the same item linked to another?

In Core Data is there a way to have one instance of an object to have multiple links to another? This is best understood with an example. You have a shopping cart object, ShoppingCart, and you have books, Book. How do you properly put multiple copies of the same book into the cart? No matter how many times you run [shoppingCart addBooks...

Core Data saves object even when validation fails

I've included the function that is handling all of the save functionality. Here's my problem. I am grabbing 5 input values and saving it as a CoreData Log Entity. Even when the Log object fails to validate, it is still being saved when I back out of the form and look at the table view. How can I force Core Data to only save the ob...