假设我有一个数组employees1:
[
{"id":"1", "name":"Bill"},
{"id":"2", "name":"Jhon"},
{"id":"3", "name":"Almas"},
]
或带有对象的数组employees2 :Employee
@interface Employee : NSObject {
NSNumber *employeeID;
NSString *name;
}
@property (nonatomic, retain) NSNumber *employeeID;
@property (nonatomic, retain) NSString *name;
第二种情况更面向对象,易于在大型项目中使用。
如果我有很多员工,employee2数组会分配比employee1更多的(2x,3x ...)内存吗?他们有多少不同?