I have an object called Layer that has some attributes and some methodes.
i need to pass Layer to a second view controller:
SecondVC *view = [self.storyb
You will need to implement copy
function to your object
In your Layer.m
- (id)copy
{
Layer *layerCopy = [[Layer alloc] init];
//YOu may need to copy these values too, this is a shallow copy
//If YourValues and someOtherValue are only primitives then this would be ok
//If they are objects you will need to implement copy to these objects too
layerCopy.YourValues = self.YourValues;
layerCopy.someOtherValue = self.someOtherValue;
return layerCopy;
}
Now in your calling function
//instead of passing self.Layer pass [self.Layer copy]
view.Layer = [[Layer alloc] initWithMapLayer:[self.Layer copy]];