简体   繁体   English

无法将SKScene委托设置为self ios8

[英]Cant set SKScene delegate to self ios8

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. 但是现在从ios8开始,我现在得到一个错误提示。 Has anyone else dealt with this since the release of ios8 how did they fix it? 自ios8发行以来,是否还有其他人处理过此问题?他们如何解决此问题?

'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.. 这是即时警告。 在此处输入图片说明

The assignment statement should be 分配声明应为

    ((TCAMyScene)theScene).myDelegate = self;

or 要么

    [(TCAMyScene)theScene setMyDelegate:self];

if you changed the delegate to myDelegate , 如果将delegate更改为myDelegate

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM