core-data

Core data / NSFetchedResultsController error

I'm having some trouble with core data / NSFetchedResultsController. I'm not entirely sure where the error is as the message is quite vague. I have an issue with inserting more than one object when the fetched results controller has no objects fetched. The following code will crash with the following error if I try and insert several o...

How to add SQLite as persistent store in CoreData?

In objective while using the the coredata concept we need to create the splite as persistent store or it will created automatically ? ...

Adding Core Data to an existing iPhone app

I have started my application and now I want to add Core Data to my app. How can I add it? ...

How to add the data in my TwitterClient.sqlite in coredata app of objective-c

I am doing coredata app and i want to add the some data in TwitterClient.sqlite but it is created automatically in my appdelegate file like below . how can i add some data in coredata app. - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (persistentStoreCoordinator != nil) { return persistentStoreCoordinato...

NSPredicate dont work with double values (%f)?

My managed object has 2 double fields: "latitude", "longitude". I need to fetch all objects, that has certain coordinates This code not working, fetchedObjects count = 0 NSPredicate *predicate = [NSPredicate predicateWithFormat:@"latitude == %f AND longitude == %f", coordinate.latitude, coordinate.longitude]; But this code work fine,...

Using NSPredicate with Core Data for deep relationships

I have an NSArrayController, companiesController bound to a top level Core Data entity, Companies. A Company has many Department's, and a Department has many Employee; these are represented by the 1-to-many relationships, departments and employees. Based on the attribute salary of an Employee I thought I could dynamica...

Adding Core Data to existing iPhone project

I'd like to add core data to an existing iPhone project, but I still get a lot of compile errors: NSManagedObjectContext undeclared Expected specifier-qualifier-list before 'NSManagedObjectModel' ... I already added the Core Data Framework to the target (right click on my project under "Targets", "Add" - "Existing Frameworks", "CoreD...

Getting NSManagedObject from another NSManagedObjectContext (referring the same NSPersistentStoreCoordinator)

Hi, i have got two different NSManagedObjectContexts both referring to the same NSPersistentStoreCoordinator, say context1 and context2. I have an NSManagedObject out of context1. As I would like to edit it, not knowing whether it will be saved afterwards, I would like to get that object from context2. Context2 could be just trashed in...

Passing CoreData content to a NSViewController

I've started to move to using NSViewControllers and I can't for the life of me figure out how to get content from a CoreData entity to a TableView (for example) through a NSViewController? ...

Case Insensitive Core Data CONTAINS or BEGINSWITH contraint

I have a predicate that looks like [NSPredicate predicateWithFormat:@"region=%@ && locality CONTAINS %@", self.region, query]; I want it to match ignoring case. Whats the trick? ...

Implementing full text search on iPhone?

I'm looking for suggestions on the best way to implement a full-text search on some static data on the iPhone. Basically I have an app that contains the offline version of a web site, about 50MB of text, and I'd like for users to be able to search for terms. I figure that I should somehow build an table of ("word", reference_to_file_con...

Core Data Store Sharing between iPhone Apps

Hi, Is it possible to share a core data store between two different iPhone apps signed by the same developer? I would like to develop an application where one iPhone app will save a stream of data, which can then be read by the other app. Is this even possible? Thanks a lot! ...

iPhone Core Data does not fetch any data from Sqlite3

I copied a filled, existing sqlite3-file to my project; it is found (I check that with - (void)createEditableCopyOfDatabaseIfNeeded { NSLog(@"Checking if we have to create editable copy of database"); // First, test for existence. BOOL success; NSFileManager *fileManager = [NSFileManager defaultManager]; NSError *er...

Getting the data from a NSTableView to a NSViewController

I'd like to have a 'Detail view' for when the user double clicks on a row, I'm just not sure how to get the data to the NSViewController, so it can display the content. I'm using CoreData and I can't think of a way to do this. ...

Segmented Controller (Multiple Choices) with Core Data

I have a Core Data based application which is built around one main entity. There are several other entities which are connected to it, one of which is an Entity called "Notes". This Notes entity has a Date (NSDate), a Description (NSString), and one other attribute. This attribute is to have 4 possible options, of which each entity w...

Setting a value in one entity programatically from another entity. Core Data questions...

I'm fairly new to Core Data, have looked through many tutorials and forums and haven't found the elegant solution to my problem: I've got three entities in my model: Worker, Task, and SubTask. Each has a to-many relationship to the entity below it and a to-one inverse. Worker has many Tasks, each Task has many SubTasks, each SubTask has...

Why should I want to have multiple Managed Object Contexts?

I don't get the point of having multiple Managed Object Contexts. Does that make any sense? The Apple documentation lacks of useful examples for these cases. ...

NSManagedObjectContext and NSArrayController reset/refresh problem

I'm having trouble getting my UI to reflect external changes (made by another process) to an sqlite data store. I have a fairly standard core data based NSArrayController / table view. My app gets notified that external changes have been made to the data, at which point I do a [managedObjectContext reset]; // brute force, but data set ...

cocoa iphone fetchedResultsController sorting

Hey there, I'm working on an app that relies on a set of data that can be sorted in a variety of ways. I've got core-data setup. I have a fetch request that brings in all of the records. I've got a sort button on the left side of the nav controller. It brings up a modal view with table that has my sort options. when you change the ...

Any good guide about iPhone Core Data?

I'm looking for some guide, I already looked at it a bit on cocoadev and in a book but I didn't find any good guide. I mean those guides were talking about multiple concepts at once so now I only want a simple straightforward guide about how to use it. Anyone knows any good guide? Thanks! ...