xcode storyboard won't accept changes

2020-04-02 08:22发布

问题:

My storyboard seems locked. I have added new labels and imageviews to two different scenes, but at runtime the labels and pictures don't show. (All original items are displayed correctly.) I have tried Clean, Build, and Building for Running, Testing, and Profiling. I have copied the entire project to another Mac. It runs the program, accepts changes in the code, but this Mac, too, will not allow changes in the storyboard. (No added items, no changing the position of original items.) It's as if the storyboard is locked for editing.

I've searched for info on storyboard locking but can't find anything that seems to apply to me (i.e. I'm not one of a team working on the same program.)

I'd appreciate any ideas.

(Xcode 4.2 on the 2nd Mac, Xcode 4.3.2 on the original where the problem first arose.)

回答1:

I had the same issue, and realized that I was playing with the Localization Locking setting, which is located on the right hand side menu under Interface Builder Documents.

Make sure that the selected setting is Nothing if you want to be able to make changes to your storyboard.

Hope this helps.



回答2:

I had the same issue in xocde6 and I got the answer on apple developer site

  1. In project navigator, select a .storyboard or .xib file.

  2. Choose a locking level from the Editor > Localization Locking menu. Refer to Locking levels for a description of the locking choices in this menu.

To unlock all the views in the file, choose Reset Locking Controls.

For example, to prevent any edits to the nib file that would impact localized strings files, choose Reset Locking Controls followed by Localizable Properties.



回答3:

The solution worked for me was after selecting locked view go to

Editor > Localization Locking > Reset Locking controls

And it will reset



回答4:

The way I solved my issue:

My storyboard Target Membership somehow got unchecked.

You'll find the Target Membership options in the same menu as the accepted answer, which is the File Inspector (first option) on the right sidemenu when you have your storyboard selected in Xcode



回答5:

I found the Launch Screen Storyboard had an outlet and I had deleted the view controller that serviced it.