IPhone: Copy/Clone -
IPhone: Copy/Clone -
i want re-create or clone object of own written class. if phone call re-create function pointer copied. if alter copied object original object changed, too.
is there way/function clone object?
best regards melanie
an object can copied if class adopts nscopying protocol , implements single method, copywithzone:.
see object copying
- (id)copywithzone:(nszone *)zone{ myclass *copy = [[[self class] allocwithzone: zone] init]; [copy setproperty1:[self property1]]; homecoming copy; }
iphone copy clone
Comments
Post a Comment