core-data

setup coredata, before appdelegate loads my mainWindow.xib

Hi, I have setup coredata in my appDelegate, but it first loads the mainWindow.xib and the corresponding controllers+views in that xib file. Those controllers need to have a managedObjectContext to load properly. And after the xib is unarchived it runs the code in my appDelegate. How can i setup my coredata and then load the mainWIndow...

Iphone Core data question

Hi, I have set up the application with 2 entity, called Category1 and category2. There is a to-many relationship between category1 and category2. When a cell is pushed in tableview (category1), a new tableview will display all category2 cells related to category1. Here is what an example: I have two category1 items in the first table...

Drag'n'Drop Support for NSTableView with CoreData Storage

Hi, I have to NSTableViews in my application both display the data which is being stored as "CoreData". The TableViews are pretty basic, as the whole programm is. The right TableView shows a list of checklists, the left shows the contents of this checklist. Now I want to allow a user to drag an item which is inside a checklist to an...

Not include temporary objects in fetch requests

Hi, I've got a fetched results controller handling a table view, and I'm having a problem that it is also showing new managed objects that have been created in the context but not saved to the store. I only want to list objects that have been saved. I have tried setting the setIncludesPendingChanges to NO in the fetch request but it's ...

Core Data: Quickest way to delete all instances of an entity

I'm using Core Data to locally persist results from a Web Services call. The web service returns the full object model for, let's say, "Cars" - could be about 2000 of them (and I can't make the Web Service return anything less than 1 or ALL cars. The next time I open my application, I want to refresh the Core Data persisted copy by call...

iphone fetchRequest sub entities?

If i fetch data from "parent" and assign it to a fetchresultscontroller, i still have to call [parent.images allObjects] in my cellForRowAtIndexPath to get to the child data. Is this a normal thing to do or can i get the real data from child right in my fetchedresultscontroller? ...

Using custom sections with NSFetchedResultsController?

I'm making a sectioned table with fetched results, but am having a hard time getting custom sections worked out. Normally one would just have an attribute to sort by, and use sectionNameKeyPath: to generate the sections. But my sorting attribute is calculated on the fly, and I can't seem to get the fetchedResultsController to use it cor...

Substituting variables inside SUBQUERY using Fetch Request Templates

I created a Fetch Request template in the Predicate Builder in Xcode. Because there are some variables that I want to subtitute with the actual value when executing the request I am using the following method. -(void)NSManagedObjectModel fetchRequestFromTemplateWithName:substitutionVariables: My request contains a subquery and the var...

Core Data bindings with subviews and multiple NIBs

I have a document-based Core Data app. My main Core Data entity has several string fields, most of which are bound to NSTextFields, but one is bound to an NSTextView. I am using the technique for view switching (with multiple view controllers) as explained in the Hillegass book. All of my subviews are controlled by a ManagedViewControll...

Core Data quesition.

Hi there, I'm trying to write two applications (iphone and desktop) to achieve what's been described in the following link: core-data-is-it-possible-to-build-a-desktop-app-to-create-the-data-model-for-an Ok. So I've created a very simple desktop app the has a single entity named Client with a string attribute field called name. I've ...

iphone core data executeFetchRequest memory issue

Hi there, I keep getting a -> Program received signal: “EXC_BAD_ACCESS”. In the following code but I don't really understand why. If I comment out the "executeFetchRequest" lines it goes away. Shouldn't the [results release]; be all that's required? Thanks in advance, Matt // Implement viewDidLoad to do additional setup after loa...

iphone data migration and application design

Hi there, I'm working on an application that has a read-only database shipped with it. The user will run the application and be able to select a series of "favourites" from the database which will appear in there "favourites" tab bar section. I.e. storing the primary keys. With each update to the application the read only data will p...

Sources for learning iPhone Core Data

Hi , i am new to iPhone. i want to learn Core Data. what are the best sources to learn it. Tutorials, Books ?? Thanks in advance. ...

How do I do an aggregate sum in a coredata query?

I have a core data table with BLOBs in it. I'd like to do a query that does the equivalent of: select sum(length(image)) from tablename; That would return the total size of all the images in the table. Is this possible in core data? ...

Error: Expected specifier-qualifier-list before ... in XCode Core Data

Hi guys, I keep on getting this error "error: expected specifier-qualifier-list for core data code im working with, in the app delegate. Now when i get this error and about 40 other errors relating to managedobjectcontext etc, i thought maybe the library needs to be imported. Now i havent done this before, but i went to Frameworks group...

Core Data Pre-populated sqllite issue, z-metadata

Hi guys, I have this issue with Core Data. I am creating a core-data-based application, for one of the tabs, to populate a UITableViewController. Basically, I have read somewhere that there is an issue with providing a pre-populated sqllite file to be used to load up the data. I created a pre-populated data file and at first had issues w...

How to open a core data database?

Is there any way in which I can view my core data database without having to load it programatically through the code?! ...

KVO - problem retrieving object from storage and displaying for edition

Hi, I've a problem with KVO and I just can't find out what it is. I have a screen that can be used to edit or create a record. That record is represented by a model object that holds a number of variables of type NSString. The controller for that string has an instance variable to hold the model currently being worked on. When I open ...

Error when automatically migrating in core data

I am trying to migrate in core data using the automatic migration. The difference between the two versions is I added an additional attribute a model. When I attempt to add the PersistentStore to the coordinator I get the following exception Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unrecogni...

Core Data : How to check for the presence of Many to Many relationship

I have a "Song" Entity and a "Tag" entity and they have a many to many relationship between them. A Song can have multiple Tags and a Tag can be applied to multiple Songs. I want to check if a Song has a particular Tag associated with it. If the Song has the Tag associted with it, I want to show a checkmark in the table view. For a sim...