在以下情况下,我应该分配还是复制?
@interface Record: NSManagedObject {
@property (nonatomic, strong) NSString* location;
...
}
将此属性分配给其他对象时:
@implementation AnyClass {
@property (nonatomic, strong) NSString* location;
...
-(void)copyValuesFromRecord:(Record *)last {
self.location = [last.location copy];
or
self.location = last.location
}
}
我对此有何看法?这是另一回事吗?
如果我需要复制的是我的东西怎么办?