core-data

Are there useful videos about Core Data?

I wonder if there are good videos out there that describe Core Data in detail, starting out with the basics? I know nothing about Core Data. Would like to watch a few videos in addition to the hard-to-read apple docs. I'm reading all day now about core data and feel my brain hasn't gained much additional knowledge ;) Please list all yo...

How to sort randomly with CoreData

I am using NSFetchRequest to fetch some items, which could be sorted by Popular, or Random. Following the guides, I could sort the items by popularity easily using NSSortDescriptor. NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"popularity" ascending:NO]; NSArray *sortDescriptors = [[NSArray alloc]...

Correct way to add relational data to Core Data

Hi All, I've created two objects in my model, Account and Friend - where 1 Account will have many Friends. I have created these two objects in code also. I am using a UITableView to show my Accounts (all fine), and using a new UIViewController to add a new record. In the new record I am adding the Account details, and getting friends f...

What to call an class that inherits from NSManagedObject?

May be a silly question, but what's a class called that inherits from NSManagedObject? Is that an "Entity" class? Or is that an "Model" class? Or an "Entity-Object" class? I mean... ok, when I instatiate that thing I get an "Object". The "Entity" itself is actually the "Class" that describes the attributes and relationships, right? From...

Open source UI framework(s) for manipulating core data in UITableViewController's

Does anyone know of an existing open source UI framework that would help with repetitive tasks like adding or editing core data objects with a UITableViewController with a fairly standard (but hopefully customizable) look and feel? When you are dealing with a lot of objects, it gets repetitive and redundant quickly. If not, I'm conside...

How to use NSFetchedResultsController to support managing data on UITableView like iPhone Photo app.

I am a beginner for iPhone development, I use core data as backed store and show multiple data entities on UITableView. Each data entity will be show as a preview thumbnail, one table view cell will hold 1 to 4 thumbnail. That's means 3 table cells may show at most 12 data entities, just like iPhone Photo. I also need operate to each of...

Core Data and NSTableView show content as title

I'm working on a menubar note-taking app with Simplenote syncing support, and it's been using a separate title and content for each note. It shows the title in an NSTableView and the content in an NSTextView, but now I would like for it to show the content as the title in the table view like in Simplenote. My problem is that I would like...

Export Core Data information to Excel Sheet

I want to have an iPhone app where the user can export the data held by the application to an Excel spreadsheet (as well as a host of other formats). So the idea is that each entity would be a new row in the sheet, with the attributes being different columns. Is this possible? ...

cocoa iphone core-data predicate one-to-many fetchrequest

I have a set of data where one of the attributes (Firmware) is a one-to-many relationship. If I want to get any records where the firmware id is 1 I can create a predicate using @"(ANY Firmware.FID==1)" Then I have another set of conditions that will refine the set even more using (TopLevel==YES) AND (Parent>0) How can I combine t...

Getting the string value from a NSArray

I have a NSArrayController and I when I get the selectedObjects and create a NSString with the value of valueForKey:@"Name" it returns ( "This is still a work in progress " ) and all I want to have is the text in the "" how would I get that? also, this my code: NSArray *arrayWithSelectedObjects = [[NSArray alloc] initWithArray:[...

Querying a 'column' in core data

I have a core data entity named "Folder". Each "Folder" has a 1-to-many relationship with the entity "File", and each file contains the field "filename". What is a succinct way of producing an array of all of the filenames for a given folder? I expected it to be something like: NSManagedObject* folder = [self getSomeFolder]; NSArray*...

How to share a ManagedObjectContext when using UITabBarController

I have an iPhone application that has a MainWindow.xib holding a UITabBarController, which in turn has a UINavigationController and a custom UIViewController subclass in its ViewControllers array. The root view controller for the UINavigationController and the custom view controller are both loaded from other xib files. The app uses cor...

Is NSFetchedResultsController also caching the record set itself, or just some meta data about table display stuff?

I fear my english is too bad for the documentation ;) it feels like they try to say, a NSFetchedResultsController also caches the record set itself, hence it may query some lame web source for half an hour and then the next time display that data super fast from the cache? Or does it just cache some data about "how to display the stuff"?...

Editing Core Data Relational Data

Hi All, I have User and Friend entities in my data model, being a one User to many Friends relationship. My ViewController, is instantiated with an instance variable for User (*user), and therefore I can access all friends by loading user.friends as friends is defined as an NSSet in my User object. In my code I load all friends in an ...

How to get Apples buggy "Locations" example to work?

Unfortunately, Apple did not test it's tutorial at all. The "Locations" demo is really buggy and the edit Button does not even exist. I have no typo. First I didn't do copy & paste, and after that, I also attempted to just copy&paste their stuff. A lot of relevant code is completely missing. They simply do this in view did load, without...

Core Data One to Many Relationship - Does Many contain attribute with value x

Hi All, As before, I have User and Friend entities, One User to Many Friend(s). I would like to be able to check to see if I have already previously added a Friend (whilst at this point only knowing the name of the potential new Friend at the time). So NSString *name = @"Bob"; Bool exists = NO; for(Friend *friend in user.friends) { ...

NSFetchedResultsController for map annotations

The documentation for the NSFetchedResultsController states that it is intended for use to 'efficiently manage the results returned from a Core Data fetch request to provide data for a UITableView object'. Could I use an NSFetchedResultsController to manage a collection of map annotations as well? I am not sure how I would do this. Any ...

What does NSExpression *lhs, and NSExpression *rhs mean?

I know what an NSExpression is, but all over the place I see these cryptographic variable names like lhs and rhs. Yes, I can guess it means something leftFoo and rightFoo, but what does "hs" stand for? No idea. ...

CoreData performance about context saving

Hello to everybody, I finished converting my app to use the CoreData layer for a small datawarehouse I want to use. I have some concerns about the performance and how to best use it. In particular: I have a lot of runs where I read from disk attributes within files: each attribute should generate a new object, unless an object of that t...

When would I want to use NSPropertyMapping?

Does it have to do with mapping between different data models? To which other Core Data classes is this related? It doesn't look too obvious to me where this belongs to. Merging data models? Or is that just a stand-alone thing? When would I use NSPropertyMapping for example? ...