In order to better learn both Cocoa and Core Data, I decided to build an application that holds cooking recipes. However, while trying to create the CD model, I already got stuck.
These are three of the classes, simplified:
Recipe:
name
ingredients
instructions
Ingredient:
name
unit (liter, teaspoon etc)
Of course, the ingredients ...
Hi there,
I've noticed I'm getting a few errors at random points in my app. I've had 2 errors, "double free" and "incorrect checksum for freed object". Heres the stack trace of a "double free" error. Can anyone provide any insight? It's happening on a call in my code that just sets an attribute to an NSNumber so I can't understand why i...
I have an app that fetches data from the internet and uses CoreData to store them in the device, for a smoother experience.
Because I use Core Data, every time my schema changes, the app crashes when I try to run it with the previous data stored on the device. What is the fastest way to detect this change and wipe all the data from the ...
Hi there,
I'm having a lot of issues with trying to perform some core data operations in a threaded NSOperation.
Currently, I have created a managed object context in my app delegate that is purely used on my threaded NSOperations. I setup a NSOperationQueue with a max concurrency of 1 so each action is performed serially. For each ope...
Boy oh boy, do I have a question that should overflow your stack.
I'm sorry, was that inappropriate? :)
But seriously, the question is as follows:
I set up an Entity using the XCode .xcdatamodel file editor. I created an entity called Person, added a few attributes, then generated a .m file to represent it. That all works fine.
Now...
I have an Event database loaded into Core Data that has duplicate Event titles. This has been made so the database can provide unique information for each day of the event. Eg fluctuations in pricing on each date.
I now need to remove the duplicate event titles from a list that will be displayed as table view with NSFetchRequest and NS...
Hi all,
I'm trying to print an NSTableView, but most of the table keeps getting cut out.
My question is twofold:
How can I get it to resize to fit one page?
How can I get it to print landscape?
If there's a better way to do it, without using the print: function, then I'm happy to receive those suggestions too! (The Table is binded t...
I have a grouped table retrieved using CoreData. The sections are based on a Boolean field in the SQLLite dB. How can I reverse the order of the groups in the table display? The default is to list the false values first (obviously, as false == 0, true == 1).
I guess I could change the database. My field name = isMandatory, so I could c...
I have a core data class Game which has a to-many relationship to another class Player. This is what their headers look like
@property (nonatomic, retain) NSSet * players; // In Game.h
@property (nonatomic, retain) Game * game; // In Player.h (the inverse relationship)
When I am releasing the last external reference that I have to the...
Hi, all!
I’m in the process of designing an iPhone app, using Core Data for data persistence (with local SQLite store[s]). Before I get too far into the implementation, I’m hoping for some qualitative advice on some basic design questions relating to Core Data.
Here’s the scenario:
The app handles data on dozens (possibly hundreds) ...
First, let me illustrate the steps to reproduce the 'bug'.
Create a new NSManagedObject.
Fault the managed object using refreshObject:mergeChanges:NO - At this time, the didTurnIntoFault notification is received by the object.
'Unfault' the object again by using willAccessValueForKey:nil - At this time, the awakeFromFetch notification ...
I have model People and model Group, People has field of type Group. How I can calculate count of group in people store?
Peoples:{name:Mark,group:linktoGroup1},{name:John,group:linktoGroup2},{name:Mike,group:linktoGroup2},{name:Jane,group:linktoGroup1}
This people will have 2 group at all.
...
Afetr inserting a new record into my CoreData store using an NSFetchedResultsController, when I then try to display the data in a grouped UITableView the app crashes with the following error"
NSFetchedResultsController ERROR: The fetched object at index 5 has an out of order section name 'Navigation. Objects must be sorted by section na...
I am developing for the iPhone and the prevailing advice on auto-generating files from entities, when using Core Data, is to select the *.xcdatamodel file and the create the new file(s) etc. This creates the *.m and *.h files in the Resources directory. These are then moved to the Classes directory or a subdirectory of Classes.
Howeve...
I have model that have field date. I need to fetch all count of records for all day of year or if no record for this day presented fetch as 0. Now i fetch all record for year and make it by hands. Can I do it using core data queries?
...
I have recently been looking at Core Data for the iPhone and I have one query which I have not been able to find an answer to in the literature.
Lets imagine that I have a User model object with a to-many relationship with a Purchase object. A User may have thousands of purchases.
All of the information I have seen thus far seems to su...
Hi there,
I'm trying to monitor my core data usage but all the Core Data instruments are greyed out in Instruments. It's also not available from the "Run with Performance Tool" in Xcode. It says that the Core Data instruments are for the Mac and it's not available on the iPhone, but I've heard people talking about using it, and it's men...
I've got about 5000-7000 objects in my core data store that I want to display in a table view. I'm using a fetched results controller and I haven't got any predicates on the fetch. Just a sort on an integer field. The object consists of a few ints and a few strings that hold about 10 to 50 chars in. My problem is that it's taking a good ...
I've been trying to learn Core Data, and browsing through questions on Stack Overflow lead me to a recommendation that I try the tutorial on Core Data over at Cocoa Dev Central (Link).
Everything is making sense so far in the tutorial, but when I got to step 16, it wouldn't let me connect the + button to the Posts array controller. I'v...
Hi all,
How would I print the contents of an entity e.g. customer?
I want the data to be table like, e.g. the entity data should print like so:
First Name | Last Name | Telephone Number | Email | DOB
I also need to apply a search predicate before printing the data, e.g. print members born after 1984
Could anybody tell me how I should...