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

Help me create an un-fubar interface-builder in Xcode4.

I created a button in the builder interface and defined an IBAction method for it in the view code. Everything went perfectly. Then I renamed the button's action method using the Xcode refactor / rename tool. Everything went perfectly.

Then I deleted the button in the interface builder by selecting the button and pressing the delete key. When I rebuilt the project, the button is still present in the simulator. Returning to the builder interface, the button disappeared. There is no link to the button in the code, but the IBAction button method still exists.

Worse still, the launch button call method calls a call, which, of course, eliminates the exception of the selector runtime that is not found. When I search the project for the name of the original action method, nothing was found, but the runtime is still trying to call it. I did clean and restored, but without joy.

If I try to open the .xib file as an ASCII property list, it tells me that the data was corrupted. (I get it.)

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

And what does "clean" do if it does not delete the binaries?

Thanks for your help!

+6
source share
3 answers

Try iOS Simulator → Reset Content and Settings. (To save time, Xcode tries to copy resources before starting, only if these resources have changed, but if everything went to nothing ...)

+1
source

Cleanliness didn't work for me. In my experience, Xcode stores the cache of a “compiled .xib” regardless of timestamps (try disabling xib for one with the same name). My solution was to change every view that needs to be updated. Very upset, but it works.

+1
source

Try going to Xcode to build> Clear all targets, it should fix it

0
source

Source: https://habr.com/ru/post/887500/


All Articles