objective c - will auto synthesize with @property(copy) NSString *string do auto copy? -
say if have property arc , auto-synthesize:
@interface a: nsobject @property (nonatomic, copy) nsstring *name; @end
now when using property, copy automatically, or have manual copy?
like
a *a = [a new]; nsstring *str = @"hello"; a.name = str; // or a.name = [str copy]?
marking property copy
work mutable instances.
don't need copy immutable instances (like nsstring).
Comments
Post a Comment