我在 iPhone 应用程序中使用 FatFractal 作为后端。一直在搜索网络和 FatFractal 文档,但没有任何运气。我想从手提包中检索集合中的最新对象:
NSArray *result = [[Store ff] grabBagGetAllForObj:thread grabBagName:@"messages" withQuery:@"Get the latest inserted object" error:&err];
我在 iPhone 应用程序中使用 FatFractal 作为后端。一直在搜索网络和 FatFractal 文档,但没有任何运气。我想从手提包中检索集合中的最新对象:
NSArray *result = [[Store ff] grabBagGetAllForObj:thread grabBagName:@"messages" withQuery:@"Get the latest inserted object" error:&err];
可能最好的方法是自己构建完整的查询,然后使用标准getArrayFromUri:
方法。以您为例,这看起来像:
FatFractal *ff = [Store ff];
NSString *query = [NSString stringWithFormat:
@"%@/messages?sort=createdAt desc&start=0&count=1",
[ff metaDataForObj:thread].ffUrl];
NSArray *result = [ff getArrayFromUri:query];
有关详细信息,请参阅http://fatfractal.com/prod/docs/queries/#sorting-and-limiting-results。