开发者

How to fix a project that Interface-Builder fubar'd

开发者 https://www.devze.com 2023-03-03 06:46 出处:网络
Help me un-fubar interface-builder in XCode4. I created a button in interface-builder and defined an IBAction method for it in the view\'s code.It ran fine.Then I renamed the button\'s action method

Help me un-fubar interface-builder in XCode4.

I created a button in interface-builder and defined an IBAction method for it in the view's code. It ran fine. Then I renamed the button's action method using XCode's refactor / rename tool. It ran fine.

Then I deleted the button in interface-builder by selecting the button and hitting the delete key. When I rebuilt the project the button is still there in the simulator. Back in interface-builder, the button is gone. There is no reference to the button in the code, but the button's IBAction method is still there.

To make matters worse, the button's original action method is getting called which of course throws a runtime exception of selector not found. When I do a project search for name of t开发者_开发问答he original action method nothing is found, but the runtime is still trying to call it. I did a "clean" and rebuild but no joy.

If I try to open the .xib file as ASCII Property list, it tells me the data has been corrupted. (I figured that out.)

Other than deleting the .xib file and creating a new view, is there any way to fix this?

And what does "clean" do if it doesn't delete the binaries?

Thanks for your help!


Try iOS Simulator -> Reset Content and Settings. (To save time, Xcode tries to copy resources before launch only if those resources have changed, but if things have gone screwy…)


Clean did not work for me. In my experience, Xcode keeps a cache of the "compiled .xib" without regard to timestamps (try switching out a xib for one with the same name). My fix was to modify each view that needed to be refreshed. Very frustrating, but it works.


Try going in Xcode to Build > Clean All targets, it should fix it

0

精彩评论

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