摘要: 一:先建议两张表Person,Score 分别代表,学生表,分数表在 Person的Relationships里面建立关系,指向分数score二:coreData生成的两个表: Person @class Score;@interface Person : NSManagedObject@property (nonatomic, retain) NSString * address;@property (nonatomic, retain) NSNumber * age;@property (nonatomic, retain) NSString * name;@property (nona. 阅读全文
posted @ 2013-12-26 15:56 cocoajin 阅读(2340) 评论(0) 推荐(0)
摘要: 一:使用Core Data 的可用数据类型NSAttributeTypeDefines the possible types of NSAttributeType properties. These explicitly distinguish between bit sizes to ensure data store independence.typedef enum {NSUndefinedAttributeType = 0,NSInteger16AttributeType = 100,NSInteger32AttributeType = 200,NSInteger64Attribute 阅读全文
posted @ 2013-12-26 11:41 cocoajin 阅读(716) 评论(0) 推荐(0)
摘要: 一:流程同样需要先查询出指定记录更新指定记录二:代码://更新操作- (void)updateThePersonData{ NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; [fetchRequest setEntity:[NSEntityDescription entityForName:@"Entity" inManagedObjectContext:self.appDelegate.managedObjectContext]]; //更新谁的条件在这里配置; NSString *th... 阅读全文
posted @ 2013-12-26 11:22 cocoajin 阅读(1161) 评论(0) 推荐(0)
摘要: 一:操作流程先查询得到某条要删除的数据然后删除某记录二:演示代码//删除- (void)deleteThePersonData{ NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; [fetchRequest setEntity:[NSEntityDescription entityForName:@"Entity" inManagedObjectContext:self.appDelegate.managedObjectContext]]; //删除谁的条件在这里配置; NSString ... 阅读全文
posted @ 2013-12-26 11:09 cocoajin 阅读(686) 评论(0) 推荐(0)