2013-01-21 47 views
0

我如何使用魔法記錄? findByAttribute獲取有序的行嗎?findByAttribute魔法記錄訂單

像我想做的事:

[Service findByAttribute: @"parent" withValue: sparent]; 

而是爲了通過名稱屬性返回的每一行。

我該如何使用魔法記錄來做到這一點?

回答

3

你正在尋找的方法是:

[Service findByAttribute:@"parent" 
       withValue:sparent 
       andOrderBy:@"name" 
       ascending:YES]; 

Here is a link自己的頭文件,其中定義所有取方法。