Delete an object in core data

后端 未结 3 1664
清歌不尽
清歌不尽 2021-02-06 00:26

I have an entity in my core data model like this:

@interface Selection : NSManagedObject

@property (nonatomic, retain) NSString * book_id;
@property (nonatomic,         


        
3条回答
  •  时光说笑
    2021-02-06 00:53

    You should perform a fetch request using an NSPredicate with the appropriate conditions, and then call the deleteObject: method on NSManagedObjectContext with each object in the result set.

提交回复
热议问题