Cant set SKScene delegate to self ios8

172 Views Asked by At

So I go back to my view controller from my skscene using the following ANSWER from a previous question I have asked. But now since ios8 I now get an error saying. Has anyone else dealt with this since the release of ios8 how did they fix it?

'NSInvalidArgumentException', reason: '-[TCAMyScene setDelegate:]: unrecognized selector sent to instance 0x79485190'

Now from this answer Delegate not found I have tried changing

theScene.delegate = self;

to..

[(TCAMyScene *)theScene setDelegate:self];

but I still get the same error. This is the warning im getting.. enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

The assignment statement should be

    ((TCAMyScene)theScene).myDelegate = self;

or

    [(TCAMyScene)theScene setMyDelegate:self];

if you changed the delegate to myDelegate,