문제

I have a viewcontroller in my storyboard that is a game. I have added a restart button and linked it to the same viewcontroller so that when the player dies they can click that and the game will start all over again. My problem is that when you click it and it restarts the game starts glitching. Any suggestions or solutions. I cant use a unwind seague so what should I do.

도움이 되었습니까?

해결책

It really depends on your code, specifically in your viewDidLoad.

Create an IBAction for that restart button in your view's class files.

For the IBAction method in your .m file, try each of these different lines of code:

[super viewDidLoad];

,

[self.view setNeedsDisplay];

, or

[self.view setNeedsLayout];

Let me know if it works, or if you have any questions.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top