Welcome, Guest
Username Password: Remember me

Ordering SCClassDefinition Across Relationship
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Ordering SCClassDefinition Across Relationship

Ordering SCClassDefinition Across Relationship 1 year, 5 months ago #1

Hi (again) everyone,

It seems that each day I have a new question about STV, but hopefully this one is easy to solve.

I have two related Core Data entities. The "Field Data" entity contains the "Data" attribute, which stores the actual data. This is related to the "Field Name" entity which contains the "Name" attribute (which is the name of the field) and the "Order" attribute (which allows for the ordering of the fields). This is setup so that I don't need to repeat the name of the field in each "Field Data" object but can instead simply relate that object to the relevant "Field Name" object.

In STV I have setup a SCClassDefinition for both the Field Data and Field Name entities. The Field Data objects display in the root STV and the user can then tap the cell to view the detail edit view and change the Field Name. I have been able to traverse the relationship and display the field name in the root STV by using the following code: fieldDataDefinition.titlePropertyName = @"fieldName.name";. However, doing the same for the keyPropertyName (so that I can order the objects based upon the order attribute in the related entity) does not work: fieldDataDefinition.keyPropertyName = @"fieldName.order";

Is there a way to traverse the relationship for the .keyPropertyName attribute so that I can custom order the objects / cells based upon an attribute in a related entity?

Thanks,
Matthew
  • skoota
  • OFFLINE
  • Expert Boarder
  • Posts: 89
  • Karma: 2

Re: Ordering SCClassDefinition Across Relationship 1 year, 5 months ago #2

Hi Matthew,


It seems that each day I have a new question about STV, but hopefully this one is easy to solve.


Thanks a lot for all your questions, we (and I am sure a lot of other users too) learn tremendously from them.


Is there a way to traverse the relationship for the .keyPropertyName attribute so that I can custom order the objects / cells based upon an attribute in a related entity?


We will do our best to add this feature to our next STV 2.0 release, due in less than a couple of weeks. Thanks Matthew
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: Ordering SCClassDefinition Across Relationship 1 year, 5 months ago #3

Great Thanks Tarek!
  • skoota
  • OFFLINE
  • Expert Boarder
  • Posts: 89
  • Karma: 2
Last Edit: 1 year, 5 months ago by skoota.

Re: Ordering SCClassDefinition Across Relationship 6 months, 4 weeks ago #4

Does this work now?
  • amilham
  • OFFLINE
  • Junior Boarder
  • Posts: 33
  • Karma: 4

Re: Ordering SCClassDefinition Across Relationship 6 months, 3 weeks ago #5

Hi Andrew,

Yes this should work now, as STV currently uses key paths to fetch the property values.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72
Last Edit: 6 months, 3 weeks ago by tarekskr.
  • Page:
  • 1
Time to create page: 1.50 seconds