NSArray from an AS list of lists or records
NSArray from an AS list of lists or records
- Subject: NSArray from an AS list of lists or records
- From: "Nigel Garvey" <email@hidden>
- Date: Sat, 13 May 2017 15:44:15 +0100
Hi.
I notice that when an NSArray is derived from an AS list containing
lists and/or records, the array itself is fixed, as expected, but the
arrays and dictionaries in it are mutable. Is this intentional or just
something that happens?
use framework "Foundation"
set ASList to {{}, {a:"aardvark"}}
set fixedArray to current application's class "NSArray"'s arrayWithArray:(ASList)
tell fixedArray's firstObject() to addObject:("Hello")
tell fixedArray's lastObject() to setValue:("world") forKey:("a")
fixedArray as list --> {{"Hello"}, {a:"world"}}
NG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden