使用RHManagedObjectContextManager 来进行 CoreData的数据处理

来源:互联网 发布:云计算服务器搭建 编辑:程序博客网 时间:2024/05/19 06:38
+(NSArray *)fetchPoiImageByPoino:(NSNumber*)poino{
   //设置选择条件   NSPredicate *predicate = [NSPredicate predicateWithFormat:@"poi_no == %d",[poino intValue]];
   //设置排序条件   NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"obj_no" ascending:NO] autorelease];
   //根据选择条件和排序条件获得结果集   return [[[NSArray alloc] initWithArray:[PoiImage fetchWithPredicate:predicate withSortDescriptor:sortDescriptor]] autorelease];}