1
我在Xcode 7.1.1中使用DBAccess框架v1.6.12。如何使用'DBAccess'執行事件觸發操作iOS ORM
我想用一個事件觸發時,INSERT,UPDATE或DELETE的行狀:
- 現有的特定時期數據的「最長」參數轉成「NO」。
- 查找具有最長「文本」的行。
- 將其行的'最長'參數更改爲'YES'。
的代碼圖像:
@interface NoteModel : DBObject
@property uint32_t dateYMD; // not unique
@property BOOL longest; // default value is NO
@property NSString *text;
@end
- (void)test {
NoteModel *obj = [NoteModel new];
obj.dateYMD = 20151201;
obj.text = @"hoge";
[obj commit]; //< HERE I want to fire the event trigger
}
DBOBJECT#entityWillInsert剛剛返回BOOL值不換款的相關信息。
謝謝你的評論。我會試試看。 – RAPT
我試過了,實現了我的目標。 現在我可以理解,能夠指向嘗試完全使用'self'關鍵字在這些方法中執行記錄,如** entityWillInsert **。 – RAPT