Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

 

Objective-C

Java

Scala

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="926492227b917cc1-204342a8-42764943-a13f9082-375d7b64c6ce20c50cddac52"><ac:plain-text-body><![CDATA[

getter

[object name]

object.name()

object.name

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="8b86bc50c097d46a-8165b0bc-49474577-bd2da245-efa05b1c8e3fec23fbb885f3"><ac:plain-text-body><![CDATA[

setter

[object setName:aName]

object.setName(aName)

object.name = aName

]]></ac:plain-text-body></ac:structured-macro>

...

To use the Scala Collections API with an NSArray or NSDictionary you simply need to add an import:

Code Block
java
java

import scala.collection.JavaConversions._

Then After that, you can may access the typical Scala collection methods directly on NSArray.  This employs a feature of Scala known as implicit conversions to automagically cast a NSArray (a Java Iterable) into a Scala Iterable while leaving the actual object unchanged.  Alternatively, you could generate an actual new scala.List instance by calling myNSArray.toList.

...