core-data

What's the best way to model _ordered_ lists of items with core data (Mac OS X cocoa)?

What's the best way to model ordered lists of items with core data? ...

How do you sync a Core-Data application between a Mac and a iPhone?

Just wondering what code I would need to do this? ...

How do you set a title so that every row in a table has the title already typed in when you add a new row?

I am using a Core-Data app, i am looking to set a pre-defined title/word so that every new row that is created already has that title/word typed in. For example the word could be 'New Task' and so when the user adds a new row it would already say 'New Task', how would you do that? ...

How do you make a Text Label display how many rows there are in the table.

I am using Core Data and want a Text Label to display how many rows there are in the table, what code would I need to enter in the class file's to do this? ...

How do I get the CoreData Debug argument to output to the console?

According to Apple documentation on debugging Core Data it says we should be able to pass an argument to the application which will output the SQL core data sends to SQLite. I have gone into the arguments tab of my executable in XCode and specified the argument: -com.apple.CoreData.SQLDebug 1 However, I see no SQL in the console. ...

How do you make a Menu Bar Item display how many rows there are in a table?

I have a core data table and would like the Menu Bar item to display how many rows there are in the table. I have already created the menu bar item using this code: -(void)applicationDidFinishLaunching:(NSNotification *)aNotification { NSStatusItem *statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItem...

Persist and rearrange the order of Core Data records

I followed the Core Data tutorial at http://macresearch.org/cocoa-scientists-part-xxiii-itunes-ifying-core-data-app The finished application displays data in an NSTableView. Is the ordering of the data persistent as well? And is there a way that you can allow drag and drop rearrangements to the order of the records? I am thinking ab...

Core Data vs. SQLite for SQL experienced developers

We're beginning development of an in-house app in the iPhone Enterprise developer program. Since it's close to OS 3.0, we're reconsidering our original design of using SQLite and using Core Data instead. Here's some more info: There is a legacy desktop application that this is replacing. We will reuse the existing back end. We curre...

How to do Core Data queries through a relationship?

I'm messing around with Core Data, and I am sure I am missing something obvious, because I cannot find an example that at all resembles what I am trying to do. Let's say I'm playing around with a DVD database. I have two entities. A Movie (title, year, rating, and a relationship to Actor) and Actor (name, sex, picture). Getting all the...

Adding non-model nodes to an NSTreeController

I have an NSTreeController that manages an entity is a core data model and an NSOutlineView that displays this tree. I would like the tree to display some special nodes that do not correspond to entities in the underlying core data model. How would I go about doing that? Should I subclass NSTreeController? ...

Property declaration for to-many relationships in Core Data

I have an application written using Core Data. I have 2 entities with a one-to-many relationship. I have subclassed NSManagedObject for both of them. The entity on the one-side is called Playlist and the other is called Song. The interface for Playlist: @interface VBPlaylist : NSManagedObject { } @property (readwrite, copy) NSStrin...

Using predicates on an array controller to filter related objects

I have an application using Core Data and bindings. I want to have an NSSearchField that can search through an NSArrayController bound to an NSTableView. The array controller contains Core Data objects that have a "name" field. I have setup the NSSearchField like this: Bind To: the array controller Controller Key: filterPredicate Pre...

Recent searches with Core Data

I'm making a Core Data app for the iPhone, but hope the question applies enough to Mac OS X to be answered in that context with no NDA issues. When a user does a search, I am saving each result into a context using entity Entry. I want these results to be retrievable later under a Recent Searches section. What's the best way to go about...

Has anyone tried any of the SQLite3 wrapper APIs for easier database functionality on the iPhone?

Coming from a non-SQL background, I've been having a hard time absorbing SQLite3 for the past few days. Has anyone had any good results using any of the SQLite3 wrapper APIs out there? Do they work reliably? Which is best? I am also hearing buzz about Core Data coming to the iPhone. Not sure whether that info is trustworthy or not but ma...

Most recent search results join in Core Data

This is a follow up question to a previous post on saving recent searches with Core Data. To group search results, I have an Entry entity and History entity. Entry.history is a relationship to History. History.entries is a to-many relationship to Entry (the inverse of Entry.history). History has a date attribute createdAt. I am trying t...

What does the "Generate Validation Methods" checkbox in the Managed Object Class Generation dialog do?

What does the "Generate Validation Methods" checkbox in the Managed Object Class Generation dialog do? ...

Matching an approximate string in a Core Data store

Hi everyone. I have a small problem with the core data application i'm currently writing. I have two differents models, contexts and peristent stores. One is for my app data, the other one is for a website with relevant infos to me. Most of the time, I match exactly one record from my app to another record from the other source. Someti...

Core data managed objects with extra ivars and methods...

Is it ok to add ivars and methods to an instance of NSMangaedObject? By "extra", I mean ivars that you don't want serialized. Do I just add them to my NSMangaedObject subclass like any other class or do I have to take any extra precautions? ...

Are Core Data fetches (NSFetchRequest) sorted in any specific fashion by default?

Hello. I have a basic question. Say you have a NSFetchRequest which you want to perform on a NSManagedObjectContext. If the fetch request doesn't have any sort descriptors set to it explicitly, will the objects be random every time, or are they going to be spit out into an array in the order they were added to the Managed Object Context ...

Concerns about Core Data

I'm getting ready to dive into my first Core Data adventure. While evaluating the framework two questions came up that really got me thinking about using Core Data at all for this project or to stick with SQLite. My app will heavily rely upon importing data from an external source. I'm aware that one can import into Core Data but handl...