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="8428ade1a7df27f1-da3373e5-4cd9481c-8ab9809c-57bdd14b773b92704ccc59f0"><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="d856a5a9a24929f1-5c10f491-49d54eb4-8c90a39e-2bf9cbcd5bb71a016c7ecf60"><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.

...