Re: Modify JSON in Swift
Re: Modify JSON in Swift
- Subject: Re: Modify JSON in Swift
- From: Roland King <email@hidden>
- Date: Sat, 07 Nov 2015 20:56:28 +0800
> On 7 Nov 2015, at 20:48, Roland King <email@hidden> wrote:
>
> Quincey explained why it doesn’t work, value semantics run deep and consistent in Swift.
>
> What you could do if you wanted, after messing with images, put it back into the json dictionary again, after your for var image in .. code
>
> json[ “images” ] = images
>
> now you have modified json to have a new images member.
oh not quite - you’re modifying images too - so you have to replace each image in that as well as you go.
perhaps use one of the array operators which takes an array and returns a new array to get new images from old.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden