iphone - Initial value of a Core Data Entities properties? -


I have several major data organizations that include a group of empty NSString properties.

I parse some XML and set the assets, which I can hold and I want to set "empty" people in "not available" as "no / no". So if my values ​​are not included in XML, then it also arranges a "n / a" string which I can test for later, in one way, any one of them in UILBL It should also be made that which is (empty) .. which leads me towards my question:

I do this test to see if the unit If the property has already sat, then zero or is empty:

 for  (NSString * s in all public strings) {if ([[f valueForKey: s] isKindOfClass: [NSString class]] & amp; [[f ValueForKey: s] isEqualToString: @ ""]] {[Set set :: "for A / To: s];} if ([[F valueForKey: s] isKindOfClass: [NSString class]] & amp; amp; [F valueForKey: S] == zero) {[set set: "" for A / K "n: a"];}}  

It has been found that I still with very values The end is being displayed as (null) so I was thinking that the property @ "" is empty or (zero)

There may be something other than I believe that NSManagedObject must conform KVC so I did a test where I had copied my NSManagedObject property by property, the only difference is that it is a sub just Ansobik instead Ansaanajd object. Regrettably, it behaves in the same way. (null)

Hope anyone can find the wrong with this string test :)

thanks

You can set the default property value of your unit to "N / A" (this is a good practice, because you use sqlite for iPhone app shipping And it does not work well with zero values ​​because sqlite and cocoa do not have the same "null" view) and set the "optional" to "no" .

  if ([[F valueForKey: s] isKindOfClass: [NSString class]] & amp; amp; [[F valueForKey: s] isEqualToString: @ "NA"]) // Tell the program to know if it is unnecessary if she should know}  

Cheers


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -