nsmanagedobject - Core Data check if property has never been set -


Is there a way to check whether the NSManagedObject property, for example a float NSNumber, in which the default value is = 0, is already Setter in Setter?

I tried to do something like this:

  - (zero) setQuantity: (NSNumber *) Quantity {if (self.quantity == zero) NSLog (@ " Property never been determined "); Other NSLog (@ "property is already set"); [Will Will Changewellfall: @ "Quantity"]; [Self setmimicity: volume]; [Aunt Keweckenzvlevforki: @ "Volume"]; }  

But "Quantity" is never started because the default value is started with. Thanks!

If the attribute has a default value set during is Start. You have 2 options:

  1. Mark the attribute as optional and do not provide the default value. You can check for zero
  2. Make sure the default value is unique and to determine that the value has been changed since the initialization, check the contrast eg, otherwise the positive number For, use -1 .

Warning for 1: Make sure that the attribute in your code is not set to zero anywhere. Warning for
2: Make sure the code is set to a specific value.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -