core-data

Some sorting problems (Core Data beginner)

Hi all. Maybe there is a simple solution to this, but I'm getting headache of this, I'm fairly new with all this Core Data stuff: I have a BankAccount class/entity with an "index" attribute, used for sorting, and a "transactions" to-many relationship to the Transaction class/entity. This Transaction entity has a "date" attribute, that ...

iPhone Core Data and Multithreading

I have an iPhone application I am developing which transfers data over the network and saves the data received in core data object for use later on. Presently. it works correctly in a single thread but I am working on converting the data transfer mechanism to run in a separate worker thread. I've read the core data programming guide on...

xcdatamodel with a new attribute

I've updated the xcdatamodel with a new attribute. i've made sure to remake the managed object class file. the add new version/set current version has been done also. I made sure to delete the app from the iPhone and even did the build > Clean all targets thing. the problem is that when I look in the sqlite file the new attribute/field...

What should I use ? core Data or sqlite in iPhone SDKc

I'm making dictionary, it have over 50000 rows. Now, I'm using sqlite for 30000 testing. It is slow for searching. I'm worrying about 50000 records. So, I'm thinking to use core data in iPhone SDK. Should I use coredata , instead of sqlite ? Which one is faster ? ...

Core Data - accessing objects returned from fetch EXC_BAD_ACCESS

The following is implemented as a class method in a category on one of my managed object entities, with a bunch of other operations: + (NSArray*)newArrayOfAllOtherBibs { NSManagedObjectContext* moc = [(MyAppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext]; NSFetchRequest* fetchRequest = [[NSFetchRequest ...

NSFetchRequest on to-many-relationship excluding some objects does not work as expected

Hi there, i struggling around NSFetchRequest these days. My data model look like this: Post <->> Category Now i need a fetch request to get all posts where the category.name attribute is not "xxx". Looking at the documentation for NSFetchRequest is should be: NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NONE category...

Accessing properties of Core Data objects via bindings from non-Core Data objects

I have a set of data created by another app and stored in XML format on disk. Since this data is managed by this other app, I don't want to bother with loading this data into a Core Data store for two reasons: 1) it would be redundant storage of the same data, and 2) I would have to constantly update my own Core Data store to match upda...

How do I change the display order of sections in a UITableview populated from an NSFetchedResultsControler?

Hi There, I was wondering if anyone knew the best solution to defining a custom display order for the sections in a UITableView - I am loading the data using Core Data and an NSFetchedResultsControler, and I am successfully using NSSortDescriptors and also successfully grouping the items returned into sections using sectionNameKeyPath: ...

CoreData on a distant server syncronizing between different clients (apps)

Hi @ All, I'd know if it exists a kind of CoreData server ? The point is to get an "automatic API server" providing data to clients. It can be useful to implement very quickly standalone Forum app, Games or anything on the cloud... ...

Filter setPropertiesToFetch with NSPredicate in Core Data?

I have a view where I would like to get an average value of a "percentage" property without loading all the objects (and their other properties) into memory from Core Data. I have found out how to do this in Apple's docs, but the problem is I would like to limit the objects whose percentages are being averaged to ones that have another p...

core data can't find model for source store - what did my old store look like??

So first, this question helped a lot with getting on the right track toward working core data versioning. So I added a new version for my model, and now I'm trying to get the automatic migration working, but I have a problem. I can't remember what my old version looked like! I'm trying to run the app on my phone, but I've been using the ...

NSPredicate syntax question

is the syntax for the line of code below correct? NSPredicate *predicate = [NSPredicate predicateWithFormat:@"type == %@",selectedAnimalType]; I want the 'selectedAnimalType' string to be used in a search to display the the user selected. I ran an NSLog statement for the %@ object and it returned what I wanted NSLog(@"%@",selectedAn...

What is the proper way to be notified of a Core Data model object being restored after a deletion?

I've got an elegant system set up using Core Data where any time a property of a model object is changed it is automatically reflected in its associated view using key-value observing but I have ran into a problem using undo. The problem occurs when I have deleted a model object. The associated view is destroyed along with all the key-v...

How can I improve core data fetch performance on the iPhone?

Core data's performance on the iPhone is absolutely miserable. Is indexing completely broken or is it just a poor implementation? I have about 21500 objects of a single type in my core data store (SQLite backing store). The objects are indexed on a UUID which is an NSString (for example, one looks like this: "6b09e200-07b6-11df-a245-002...

Core Data Relationship Failing to Load To-One Relationship

I have a to-one relationship between a Document and Settings model: On creation of a Document, a corresponding Settings object is created. The models are persisted to core data. When relaunching after creating a few documents (and the associate settings), the application reloads a list of documents to select using: // Load delegate ...

Should I use Core Data or SQLite to represent a graph structure with weighted edges?

I am building an iPhone application that will be using a weighted graph (probably around 1000 nodes and 500-700 relationships, ball park estimate, could be quite wrong). Core data would be wonderful since it's easy to work with and is optimized for the iPhone. At the same time, the graph nodes need to be weighted. I could add a leve...

Creating multiple relationships between objects

I have a core data model with 2 entities: Collection and Image. There's a one to many relationship between Colletion and Image, reflected by an 'images' accessor on the Collection side and a 'collection' accessor on the Image side. There's an additional relationship called keyImage, which is a 1:1 relationship between Collection and Ima...

Copy core data database between two iphone

Hi! I'm coding an app with core data. I need to sync the database between two iphones running the same app maybe via bonjour... Can anyone help? Thankyou! ...

Very large NSDictionary vs Core Data vs SQLite for read-only look up on iPhone?

I'm tinkering around with a iPhone word app where I am using a DAWG structure for finding anagrams from a user defined word bank in real time as the user types. That part works well. As the words are identified, I want to retrieve specific information about each word which I currently have in a plist file (keyed by word). This informa...

Equality with CoreData string attribute not working

Hello, I can't see why this isn't working. I have two entities, let's call them Employees and Departments. And Departments has a String attribute called division. This works perfectly: NSLog(@"Division: %@",employee.department.division); The console shows, let's say, "Worldwide Seafood". But if I attempt a comparison with the exac...