core-data

Is there a Java equivalent to Apple's Core Data?

I have recently heard a lot of praise for Apple's Core Data architecture. Is there something similar in Java land, so that I can play around with Core Data's ideas (in order to evaluate how it stacks up against something like Hibernate) without having to get into Cocoa/Objective-C first? ...

Shared Objects in Cocoa

Hey guys. I'm working with CoreData in Cocoa (not document-based). My problem is, that I want to access the SAME NSArrayController from different NIBs. But every NIB has an own instance of this NSArrayController. My question is now how I could generate sharedObjects (like the NSUserDefaultsController). It would help me a lot. Thanks fo...

How to get some values from CoreData-Entities to code.

Hey guys! =) I've created in my CoreData app an entity with some attributes. Imagine a tableview and a bound NSArrayController. With both I create (and edit) my entity "instances". My question is how I can get the values of these attributes to my code. If there are more questions: http://twitter.com/xP_ablo ...

"Save" in CoreData-apps

I've here a CoreData app (no document-based), 1 entity and 1 tableview for edit/add/remove "instances" of the entity. Now I can manual add and save but I would like to a) save automaticly changes b) add automaticly some "instances" with the first start. I think a) can be solved with NSNotifications. But which to use by entities? ...

Save CoreData-entities in NSUserDefaults

Imagine an CoreData entity (e.g. named searchEngine). NSManagedObjectContext manages some "instances" of this entity. The end-user is going to be able to select his "standard searchEngine" with a NSPopupButton. The selected object of NSPopupButton should be binded to the NSUserDefaults. The problem: 1) @try{save} a) If yo...

NSManagedObjectID into NSData

I found this wonderful NSManagedObjectID. This would be very good for referencing an Entity/NSManagedObject/NSEntityDescription, right? Let's get an ID from an entity: NSEntityDescription *entity = [self newEntity]; NSManagedObjectID *objID = [entity objectID]; So... any idea how to get this objID into a string? Or better: NSData...

Core Data vs SQLite 3

I am already quite familiar with relational databases and have used SQLite (and other databases) in the past. However, Core Data has a certain allure, so I am considering spending some time to learn it for use in my next application. Is there much benefit to using Core Data over SQLite, or vice versa? What are the pros/cons of each? I ...

Remove correctly selected NSManagedObjects

Look at this great screenshot and I think you can imagine what I could ask... The players: to the right: the preferences-panel and a NSTableView to the left: main-window with a NSPopUpButton (under the NSMenu ;] ) The selected object of the popup is binded to one of these in the tableview. This ugly thing (what you can see th...

NSManagedObjectContextObjectsWillChangeNotification

Hey! I need something like an opposite to NSManagedObjectContextObjectsDidChangeNotification. Something like NSManagedObjectContextObjectsWillChangeNotification. I think this would solve this problem (stackoverflow-question). It's importent that it notificates before it deletes the object (in that problem) for changing the selected NSMen...

Storing an NSImage in a Core Data Model

What is the correct way to store an NSImage in a Core Data Model? I have assumed adding an Attribute to an Entity and giving it the Type "Binary" should work, but it is not working. I have a table with a column of NSImageCells and it is not showing anything. ...

Does Core Data exist on the iPhone? Or how would you save Data on the iPhone?

Lets say I make an App that enables users to make short notes and write things down. Is there Core Data on iPhone OS too? Or how else would you save that data in iPhone? ...

Traversing multiple Core Data objects using NSPredicate

I am having a problem with a Core Data model in Cocoa. It's probably a fairly basic problem. A section of my Core Data model is shown below. Given the value of a cell property in the OutputCell entity, I want to return the relevant HistogramBar. I'm using the following Predicate but it just returns an empty array. I've managed to ge...

Creating a Core Data Inverse Relationship

I'm trying to write my first Cocoa app, and Core Data is making it difficult to model my data objects. I have two entities that I want to manipulate: Account and Transaction. Account has a human-readable name and that's about it. Transaction stores a monetary value, and references to two accounts called debitAccount and creditAccount (I'...

iPhone Core Data Example produces exception

No longer under NDA. There was an ommision in the iPhone Core Data example, but is now corrected. Also the sample code was always correct, they just left out some details in the tutorial. (Please refer to iPhone Dev Forums for explanation) I built an app twice and received the same error twice (but in 2 different places): Termina...

KVC compliance for numbers in NSManagedObject subclass (CoreData)

I'm trying a basic test of sorting an NSManagedObject subclass. I set up a basic subclass "TestClass" with two attributes: stringField and numberField. They use the standard Obj-C 2.0 accessor protocol: @interface TestClass : NSManagedObject @property (retain) NSString *stringField; @property (retain) NSNumber *numberField; @end @imple...

Core Data syncing

Hi, is there a way to automatically sync my Core Data Model with a server (preferably REST)? Thanks ...

Does every Core Data Relationship have to have an Inverse?

Let's say I have two Entity classes: SocialApp and SocialAppType In SocialApp I have one Attribute: appURL and one Relationship: type. In SocialAppType I have three Attributes: baseURL, name and favicon. The destination of the SocialApp relationship type is a single record in SocialAppType. As an example, for multiple Flickr accounts...

How would you make a checkbox delete a row in a table if checked (Cocoa) ?

My App Uses Coredata and Displays Data in a table, one column has a checkbox and one has the title. What i want it to do is that when the checkbox gets checked it deletes the row instead of people having using the Remove/Minus button. The reason I want this is because my app is a Task Management app. ...

Disable undo for creation/deletion of NSManagedObject

In my Core Data model, I've got a relationship called listItems which links to several listItem entities, each with a stringValue attribute. I've created a control which is essentially a list of NSTextFields, one for each list item. The control is bound to listItems properly, and I've set it up so that pressing the return key creates a n...

Is there a preferred method of database management/object persistence on the iPhone?

I've seen several approaches, and each seem to have significant plusses and minuses. I'm learning iPhone development, I'm building a relatively simple app, which, at it's core, is really not much more than CRUD operations on 3 or four related entities. I'm used to ActiveRecord-type object persistence. The implementations for Cocoa Touch...