Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Simple iPhone App with Swift Views and View Controllers View Controllers and IBAction

Getting an error in Xcode 6.0.1 when trying to connect the button in iOS-Swift - Build A Simple iPhone App With Swift.

hi

i'm getting an error when attempting to connect the button to code in your iOS-Swift course, “Build A Simple iPhone App With Swift,” where the video teacher is pasan premarantne. when i attempt to control-drag and fill in the pop-up the way he instructs in the code, with the following parameters -

  • connection - action
  • object - ViewController
  • name - showFunFact
  • type - AnyObject
  • event - Touch Up Inside
  • arguments - none

when i attempt to put it in the code where pasan says to, it comes back with this error in the pop-up dialog in Xcode 6.0.1 —

“(!) Could not insert new action connection: Could not find any information for the class named ViewController.”

here's a screen shot of that —

Screen shot of pop-up connection dialog for button error in Xcode v.6.0.1.

???

please help. i am stuck here and cannot proceed until a workaround, proper instructions or a fix is made. please advise.

— faddah wolf portland, oregon, u.s.a.

3 Answers

ok, i had to hop on freenode IRC for an answer in a channel full of fellow iOS/Mac OS X/Obj-C/Cocoa/Swift coders in portland, oregon, where i'm from, called #nspdx (“ns” being for “next step” legacy API code which proceeds most Cocoa calls). a fellow there shared with me how he would do it. i sent him my code via a dropbox upload - strangely, he was able to see the "dot" for the code connection in the left margin of the Editor, where i was unable to ever get it - and he's using Xcode v.6.0.1 just like me. weird.

so anyway, here's a video of what he did —

https://dl.dropboxusercontent.com/u/575564/hookup.mp4

basically, having been an iOS/Mac OS X/Xcode/Obj-C/Cocoa coder for some time, he used an “old school” method with Xcode of —

  • choosing the ViewController in the expanded Document Outline pane next to the Interface Builder
  • choosing the Connections Inspector in far right pane after that (last, far right icon at top of pane)
  • making sure showFunFact had a listing there as an object receiving actions
  • right-click or option-click and drag from the showFunFact button in Interface Builder up to ViewController in the Document Outline pane
  • check that showFunFact now shows as having the connection with the action “Touch Up Inside” in the far right Connections Inspector.

mine did after doing that, i built it and ran it in Xcode, and now all runs fine and i can proceed with the other modules. it successfully gave the “You pressed me!” in the Xcode v.6.0.1 console pane when the showFunFact button was pressed. so now, onward.

i think i seriously need to reinstall all of Xcode v.6.0.1 to find out or just fix what the hell is going on. but that's the solution that got me beyond this. thanks all.

best,

— faddah wolf portland, oregon, u.s.a.

manually write the code Pasan has automatically generated in the Assistant Editor for the View Controller. A small dot will appear next to the first line "@IBAction...", which, in my case, is line 23. Click and drag from the dot to the button.

Gareth Gomersall
Gareth Gomersall
2,890 Points

This worked for me, and after doing it this way and then trying the control-drag, it started working again with out the error message.

hi Michael Voccola ,

thank you for your response. i had thought of doing this. however, in my Xcode v.6.0.1, no connector dot appears next to the —

@IBAction func showFunFactButton() {
}

... so i can't click and drag from the dot in the coding margin to the button in the Interface Builder in Xcode 6.0.1, as there is no dot. anything else i can do? also, will this video and instructions be updated for problems like this?

here's a screen shot so you can see what i am talking about —

Screen shot of no dot showing up next to typed in code for connection to Interface Builder in Xcode v.6.0.1.

please advise. and thank you again for responding.

best,

— faddah wolf portland, oregon, u.s.a.