开发者

Wired a calculator button without the code, deleted it, and now simulator crashes

I'm fairly new to xcode so I apologize if this question is trivial. I'm following the lectures on itunesU for CS193P if that helps to know bef开发者_运维知识库orehand.

I created the calculator and everything was running fine. I then wired up a sqrt button in the xib file to my IBAction operation pressed. However, I did not have the code implemented in it in my CalculatorBrain.m file. I ran the program, and it worked just fine until I hit an operation (*,+,etc) so I deleted the sqrt operation thinking that would be the source of the error but it still crashes.

Any idea what I need to do in order to return the program to a working state? Thanks


you have to remove your reference in Interface Builder when you delete an object (i.e. the button).


I am not sure if you remove the implementation of button action from .m file, will crash. but if you would have deleted from .h file then you should removed the action of your sqrt button. Open the xib file and there you can see the warning(with yellow highlighted color with * symbol) just click on that problem solved

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜