0

OK, so here's the deal...

I'm trying to connect even the simplest actions (the typical ctrl+drag from the UI builder to the corresponding file), the actions are created fine, but they're not working.

What the UI (with a test action) looks like:

enter image description here

And the corresponding part in AppDelegate.swift (which doesn't get called no matter what)

enter image description here


In case it makes any difference:

  • macOS : High Sierra 10.13.2
  • Xcode : 9.1 (9B55)
  • Project platform : macOS
  • Project language : Swift
  • Storyboards : NO
  • Auto Layout : NO

Which files should I have a look into, in case something has been corrupted?

I have had a look into MainMenu.xib but the <connection> and <action>s there seem to be linking the correct things. Maybe it's the project.pbxproj file?


Note: The project in question is a result of (automatically) duplicating a previous Xcode (+Swift) project, so chances are something might have gone wrong during the process. (although it normally works for me). Let's see...

Dr.Kameleon
  • 22,532
  • 20
  • 115
  • 223

2 Answers2

0

The first and possibly only place to sanity check Outlets,Segues,Actions is this right panel menu in Xcode:

enter image description here

Brian Ogden
  • 18,439
  • 10
  • 97
  • 176
  • Unfortunately all the actions (+ outlets) show fine. The code looks good. All of a sudden, it just doesn't get called. (Just updated my initial question) – Dr.Kameleon Dec 24 '17 at 10:01
0

I am thinking that the @IBAction line for buttonClicked should be in the viewController file instead of the AppDelegate file