When should I check "use scalar properties for primitive data types" during creating NSManagedObject
objects?
What it will cost me (will my data base improve performance or be more lightweight)?
When should I check "use scalar properties for primitive data types" during creating NSManagedObject
objects?
What it will cost me (will my data base improve performance or be more lightweight)?
在iOS 5和OSX 10.7之前,标量属性不能自动生成,必须添加setter和getter实现,这会造成一些损失.自动生成的属性得到优化.我不知道还有其他处罚.
Scalar and non-scalar properties are represented by the same types in DB, so there will be no change in DB's size.
您应该根据访问这些属性的方式 Select 何时使用标量.例如,如果要将标量属性添加到集合(NSArray、NSSet、NSDictionary),则需要在cocoa对象中封装标量属性.