How can I make a copy of an existing graphic, make changes to the copy, and add it as a new feature.
AGSGraphic *newGraphic = oldGraphic;
newGraphic setAttributes(whatever) also changes the attributes of oldGraphic, because of the pointer to a pointer.
How do I just make a copy?
Thanks.
Solved! Go to Solution.
Given you have an old graphic, you can encode to JSON and pass that to the new graphic, will create a copy using JSON.
AGSGraphic *newGraphic = [[AGSGraphic alloc] initWithJSON:[oldgraphic encodeToJSON]];
Hope this helps
Cheers
Al
Given you have an old graphic, you can encode to JSON and pass that to the new graphic, will create a copy using JSON.
AGSGraphic *newGraphic = [[AGSGraphic alloc] initWithJSON:[oldgraphic encodeToJSON]];
Hope this helps
Cheers
Al