I have a BOOL in my master data. I want the value to be null unless I set it to either YES or NO. Is it possible to do this? in my code, how can I check if a value is set yet or not?
In my nsmanagedObject I use NSNumber for my BOOL, in my base mdoel file I have BOOL.
CoreData allows you to set default values. Bool may contain "YES", "NO", "None". Setting the default value to No makes the return value null, which is exactly what I need.
Boolean , , NSNumber.
NSNumber
, NO, . false , .
NO
, , , nil , , .
nil
- , "" "" "" , , . Core Data "" , . Core Data :
[myManagedObject setValue: nil forKey:@"attributeOfMyManagedObject"];
SQL , "NULL", .
Source: https://habr.com/ru/post/1775714/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1775709/how-do-i-associate-a-file-extension-with-an-application-using-a-desktop-file-under-linux&usg=ALkJrhi-CzdAnY3mAp7_QjKRXoMEzla0PQHelp me with a "or" jquery selector? - javascripttypehinting: метод должен принимать любой $arg, являющийся объектом - oopThe algorithm for finding the minimum spanning tree when the cost is specified by multiplying the weights of the edges - optimizationTransparent accent color - windows-phone-7A compiled EF request occasionally raises a SqlException - c #Android app. Can we reuse images while we work? - androidDuplicate JavaScript names. Is it really bad? - javascriptHow can I get the text of a hidden element in jQuery? - jqueryhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1775719/can-a-subversion-repository-be-moved-but-its-mirror-remain-the-same&usg=ALkJrhge5_pYbolOWBnaOjGTsEoTQ_iNYgAll Articles