core-data

What exactly are those data types int 16, int 32 and int 64 on the iPhone, in Core Data?

The Xcode data modeler shows me those three different int data types. When I would write code, which data types do these really correspond to on the iPhone? Are they all simply NSInteger, wrapped in an NSNumber? As far as I see it, NSNumber only differentiates between int an NSInteger... so I guess those three end up beeing pretty much ...

Calling NSFetchedResultsController & CoreData experts

I am having a few nagging issues with NSFetchedResultsController and CoreData, any of which I would be very grateful to get help on. Issue 1 - Updates: I update my store on a background thread which results in certain rows being delete, inserted or updated. The changes are merged into the context on the main thread using the "mergeChan...

Which methods are good to overwrite when creating custom NSManagedObject subclasses?

The Core Data Programming Guide talks a lot about what not to overwrite. So the question is: What is good to overwrite? Like I see it, I can't overwrite -init or -initWithEntity:insertIntoManagedObjectContext: So where else would be a good overwrite point to set up some basic stuff? Or is it generally not needed to do custom initializ...

What's the reason why core data takes care of the life-cycle of modeled properties?

The docs say that I should not release any modeled property in -dealloc. For me, that feels like violating the big memory management rules. I see a big retain in the header and no -release, because Core Data seems to do it at any other time. Is it because Core Data may drop the value of a property dynamically, at any time when needed? A...

Do I have to -release a transient property in -dealloc?

Is a transient property a "managed property" in terms of Core Data? Does Core Data manage it's memory too? Or must I -release that manually in -dealloc? (I think no, because I might choose to not create a subclass - but I guess it doesn't make sense when I have a transient property, since I need a subclass to calculate that derived valu...

Core Data and poor performance

I've been working this issue for a while now and I am open to any best practices/advice. The Example So I created a sample Core Data application. The application is basically a mimic of the AddressBook application. I have the following Entities: Group, Contact, Address, Phone, Email, Webpage, Dates. As you probably are guessing, a Gro...

Problem with saving with Core Data!

Hi everyone! I have an iPhone application, which lets the user add and and modify Assignments. Each Assignment entity is has a relationship with another entity: Course. When the user adds a new Assignment, he has to choose a Course. So far, so good. But the list of available courses is editable, so while the user is adding an Assignmen...

Are managed properties already set to default values when -awakeFromFetch is called?

Are managed properties already set to default values when -awakeFromFetch is called? ...

Which one should I prefer for relasing my custom non-managed properties?

-willTurnIntoFault or -didTurnIntoFault? I guess it's stupid to release properties in both of them, so I must choose one. Which is the best? ...

Does the NSManagedObject instance still float around in space when it turns into a fault?

Or is turning into a fault the same as deleting that thing completely? I mean... is that guy then just still alive as a super lightweight object with no big data inside, or is it actually deleted? Or: Is a fault an object in memory with low footprint, or is that a "virtual object that COULD be there, but isn't yet"? ...

NSFetchedResultsController not processing certain section driven moves

I utilize a NSFetchedResultsController (frc) with a Core Data store. I implement all the frc delegate methods. The table is sporadically updated by background threads. All the inserts, deletes and updates work fine, with the exception that updates to the frc's index key for rows toward to the bottom of the table (50 rows), do not result ...

What's the name for properties which are not managed by core data?

Would I say "unmanaged" property? Is there a special name for this? (talking about subclasses NSManagedObject with additional properties that are not in the data model) ...

How to write a value validation method for core data?

The docs say: you should implement methods of the form validate:error:, as defined by the NSKeyValueCoding protocol so lets say I have an attribute which is an int: friendAge I want to make sure that any friend may not be younger than 30. So how would I make that validation method? -validateFriendAge:error: What am I gonna do...

Dealloc'd Predicate crashing iPhone App!

To preface, this is a follow up to an inquiry made a few days ago: http://stackoverflow.com/questions/2981803/iphone-app-crashes-when-merging-managed-object-contexts Short Version: EXC_BAD_ACCESS is crashing my app, and zombie-mode revealed the culprit to be my predicate embedded within the fetch request embedded in my Fetched Results C...

If I create a transient property in the model, isn't this managed by core data then?

Just to grok this: If I had a transient property, lets say averagePrice, and I mark that as "transient" in the data modeler: This will not be persistet, and no column will be created in SQLite for that? And: If I make my own NSManagedObject subclass with an averagePrice property, does it make any sense to model that property in the xcda...

Does Core Data automatically validate new values when they are set?

In this question, someone asked how to write a validation method for Core Data. I did that, and it looks cool. But one thing doesn't happen: The validation. I can easily set any "bad" value and this method doesn't get called automatically. What's the concept behind this? Must I always first call the validation method before setting any v...

What is an inter-property value in Core Data?

From the documentation: NSManagedObject provides consistent hooks for validating property and inter-property values. You typically should not override validateValue:forKey:error:, instead you should implement methods of the form validate:error:, as defined by the NSKeyValueCoding protocol. If you want to validate inte...

Is there an difference between transient properties defined in the data model, or in the custom subclass of NSManagedObject?

I was reading that setting the value of a transient property always results in marking the managed object as "dirty". However, what I don't get is this: If I make a subclass of NSManagedObject and use some extra properties which I don't need to be persistet, how does Core Data know about them and how can it mark the object as dirty when ...

When exactly is -willChangeValueForKey: or -didChangeValueForKey: called?

In this article, I was reading this: Calling -[willChangeValueForKey:] and -[didChangeValueForKey:] marks an object as dirty, regardless of the key. When exactly is -willChangeValueForKey: or -didChangeValueForKey: called? ...

What happens under the hood, when I access an attribute by KVC in Core Data?

I was reading that doing so will trigger KVC notifications. But how exactly does that look like? What does that mean? ...