• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSArray from an AS list of lists or records
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSArray from an AS list of lists or records
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Property List Tools osax with Framework Foundation
  • Next by Date: Re: NSArray from an AS list of lists or records
  • Previous by thread: Re: Property List Tools osax with Framework Foundation
  • Next by thread: Re: NSArray from an AS list of lists or records
  • Index(es):
    • Date
    • Thread