Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I set transient properties to fetch?

I want to create NSFetchRequest and set properties to fetch like this:

request.propertiesToFetch = @[@"a", @"b", @"c"];

where a and b are stored in Core Data database, and c is transient. executeFetchRequest: fires an error Invalid keypath c passed to setPropertiesToFetch:. But if I uncheck transient-checkbox for property c everything will work fine. So is it really impossible to fetch transient properties or I'm doing something wrong?

like image 949
Valentin Shamardin Avatar asked Aug 07 '13 06:08

Valentin Shamardin


People also ask

What are transient properties?

A transient property is a property that is not persisted to the database. Transient properties can have non-null values on the clipboard, but when a clipboard page containing transient properties is saved to the PegaRULES database, the values are removed from the Storage Stream column.

What is transient in Coredata?

Transient attributes are properties that you define as part of the model, but that are not saved to the persistent store as part of an entity instance's data. Core Data does track changes you make to transient properties, so they are recorded for undo operations.


1 Answers

Yes, it is really impossible. You can't fetch them because they don't exist in the persistent store - that's what it means to be transient. You can fetch whatever persistent attributes the derived, transient, attribute is created from.

like image 105
Wain Avatar answered Oct 03 '22 08:10

Wain