2

I've a NSDocument and it saves and read some data. I'd like to use these data in my ViewController. How can I access it? I haven't found any information about doing this in swift, only in obj-c but when I translated it into swift it always fails.
More precisely:
I have a dictionary(my property of Document) which stores all data - I save from this dictionary and read to it. And I'd like to access this property(dictionary) from ViewController.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Gun13
  • 103
  • 9

1 Answers1

2

I found a solution:

(self.view.window?.windowController?.document as! Document).arch.objectForKey("saved")

And what is important - call it in viewWillAppear!

Gun13
  • 103
  • 9