> On Oct 19, 2015, at 1:53 PM, Eric E. Dolecki wrote:
>
> I am asking if there is a way to call a method or set a property on an
> ViewController object from another class.
Sure, you just need a reference to it.
> let foo = ViewController()
> foo.object.hidden = true
> Something like that, b
By effect I meant it works as expected. Even when I set a variable to that
ViewController, I get the error. I am asking if there is a way to call a
method or set a property on an ViewController object from another class.
let foo = ViewController()
foo.object.hidden = true
Something like that, but
> On Oct 19, 2015, at 11:12 AM, Eric E. Dolecki wrote:
>
> I have been using NSNotificationCenter to affect objects in other classes
> to good effect.
I don’t understand … that class is used to register notification observers and
to post notifications. What do you mean by “affect”?
> *ViewCo
I have been using NSNotificationCenter to affect objects in other classes
to good effect. However, is it possible to do something like this:
*ViewController().someObject.hidden = true*
When I compile and run, I get a EXC_BAD_INSTRUCTION at that line.
*fatal error: unexpectedly found nil while un