ios - Coredata and automatic sorting of relationships -


I have a managed object tour that has many points when I load points to show them in a table , Then I use my data as tour point.

Each point has a field 'level' in which it shows the order in which they should be visible. How can I create tour.points to sort myself according to point.pell?

Should I give a different description, or is there any direct way?

The best way to populate a table view with core data is to have a NSFetchedResultsController Is. The FRC has a fetch request in which you can attach an ingenious and sort discriptor.

There are some easily available sample codes that you can copy from Xcode template when checking "Use core data".

In the Faxed result control construct method, add predicate and sort discriptor. I am assuming that you are bringing an institution called point , which is related to excursion .

  fetchRequest.predicate = [NSPredicate PredicateWithFormat: @ "tour =% @", tourObject]; FetchRequest.sortDescriptors = @ [[NSSortDescriptor sortDescriptorWithKey: @ "Level" Climbs: Yes]];  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -