1

I am building an app right now and using storyboards for the user interface. Storyboards were working great until about a week ago. Suddenly, they began to give me trouble. I posted a couple of Stack Overflow question regarding issues about storyboards. I have been experiencing all of the following issues:

  • Actions connect as AnyObject instead of Any when connecting them from storyboard.
  • I receive an error unrecognized selector sent to instance 0x7fb80e92bc00 due to objects not connecting from storyboard to source code.
  • Unwind Segues do not work. When I try to connect one, it doesn't even show any available.
  • I cannot select any of my UIViewControllers from the dropdown menu under the Identity inspector which I discussed more about in this question.
  • Inherit module from target does not get automatically selected in Interface Builder.

Here are the following things I have tried:

  • Clean the build folder.
  • Restart Xcode.
  • Restart my MacBook.
  • Delete derived data.
  • Tried a different storyboard.
  • Deleted some of the files that were giving me trouble (which is no longer an option as all files are giving me trouble).

New issues pop up everyday and it is getting more difficult to build my app when these issues occur. Why is this happening and is there any solution available?

  • Make sure you have disconnected any component added to the storyboard, from which you have removed only the reference in the code. – Daniel Muñoz Aug 02 '19 at 00:06
  • "Actions connect as AnyObject instead of Any when connecting them from storyboard" Perhaps you have accidentally opened an older version of Xcode? That's how things _used_ to be. – matt Aug 02 '19 at 01:06
  • @matt Actually, I am using Xcode 11 beta 5. It happens on version 10, 11 beta 2, 11 beta 4, and 11 beta 5. –  Aug 02 '19 at 01:08
  • @DanielMuñoz I have made sure that I removed only the reference but the issue is still occurring. I cannot connect my IBActions to code. –  Aug 02 '19 at 01:10
  • Could you take a moment to try it with a plain vanilla project freshly made from the Single View app template? Let's see if the problem is Xcode or your particular project. – matt Aug 02 '19 at 01:13
  • I should point out that if it turns out to be your project, it's not the end of the world. I've often migrated all of a project's contents into a new project. Sometimes projects just get hosed and you have to do that. – matt Aug 02 '19 at 01:17
  • @matt Strange because the same thing occurs with a plain single view app. All of the same issues occur in Xcode 10 as well. Maybe it has something to do with broken files on my Mac? –  Aug 02 '19 at 18:44
  • I have one more thing to try. What if you give your Mac a new User and log in as that user? You can still see Xcode because it is in Applications. So are the same issues still present? If not, we can suspect the Xcode installation in your original User. – matt Aug 02 '19 at 18:51
  • Basically what I’m leading up to is that we may be about to delete your prefs and caches. It’s annoying because you lose some settings, but if we think it will fix the problem it could be worth it. – matt Aug 02 '19 at 18:59
  • @matt I just created a new Mac user and the storyboard issue does not occur with that new Mac user. Deleting my prefs and caches is fine with me as long is it can possibly resolve the problem. –  Aug 02 '19 at 19:37
  • Ok well go back to your normal user, quit Xcode, delete _~/Library/Caches/com.apple.dt.Xcode_ and _~/Library/Developer/_ and _~/Library/Preferences/com.apple.dt.Xcode.plist_ and see what happens. – matt Aug 02 '19 at 19:42
  • @matt OK, I deleted the files you told me to delete and then I opened up Xcode. The only thing different I see so far is that storyboard is not loading and it says "An internal error occurred." –  Aug 02 '19 at 19:54
  • Well that doesn't sound promising. Does it help to restart the computer? I can't imagine why Xcode would just stop working because you did the things I described; we're cleaning out its preferences, that's all. – matt Aug 02 '19 at 19:59
  • @matt I restarted my computer and its fine now. Must have just been a little bug. Nothing else is different though... –  Aug 02 '19 at 20:04
  • Well, that's extremely interesting. Did you really delete the files I suggested? Note that I revised my instructions several times; be sure you have the latest version. :( Restart the computer, delete the files, restart the computer, start up Xcode. If that doesn't fix it, I'm going to be very surprised. We won't be at a loss — it's all working fine in the new clean user you made — but I'm trying to clean _this_ user and I'm surprised we're failing to do so. – matt Aug 02 '19 at 20:11
  • @matt Still no fix. I'm surprised as well... I have deleted the files you have told me to and then I restarted the computer and it is still not working. Anything else that can help me out? –  Aug 02 '19 at 20:26
  • Maybe, but I’ve no idea what it is. At this point I would just migrate into the new user completely. – matt Aug 02 '19 at 20:29
  • @matt OK. I'm gonna search a little more to see if there is any other solution but I guess I'm just gonna have to use the new user. That's very frustrating but whatever... –  Aug 02 '19 at 20:34

1 Answers1

0

I am facing the same issue in Xcode beta version. It generally facing when create new file. I resolved by following steps

  • Remove File reference
  • Add file again. (If file add with "copy" suffix, delete original file from source folder remove "copy" from file name)
  • Now try to connect with your reference, it will work
Mitesh
  • 504
  • 2
  • 8