1

I'm wondering if NSTask is not available in playgrounds. This does not compile

import Foundation
let task = NSTask()

Does anyone know if that's not (yet) possible or am I missing something?

Update It's possible to create iOS or OS X playgrounds. One can also change the chosen platform after the initial creation of the playground: Xcode > View > Utilities > Show File Inspector (cmd+opt+1) -> There is a drop down menu for the platform.

benrudhart
  • 1,406
  • 2
  • 13
  • 25

1 Answers1

5

I just tried it with an OS X playground (which do exist, past me) and it compiled without issues.

import Foundation
let task = NSTask()

Outputs NSConcreteTask, and println() on the task gives <NSConcreteTask: 0x7fe4f1f27360>. Make sure it is an OS X playground though, as iOS does not include NSTask

JustSid
  • 25,168
  • 7
  • 79
  • 97