Swift code not working anymore

Hi,


I am making an OS X application in Swift and I'm having a few problems. I have some code in my project that has worked before but it isn't working now. It's not even giving me an error. I just doesn't work at all, period. The code worked before, so I have no idea why it isn't working now. Any suggestions?


I am running Xcode 7.3.1 on a 2015 11-inch MacBook Air which is running OS X 10.11.5.

MACBOOK AIR (11-INCH, EARLY 2015), OS X El Capitan (10.11.5), Xcode 7.3.1

Posted on Jun 2, 2016 5:08 PM

Reply
12 replies

Jun 2, 2016 9:16 PM in response to NathanaelC16

Hello again NathanaelC16,

You did say "Xcode 7.3.1 on a 2015 11-inch MacBook Air which is running OS X 10.11.5". Those are both brand new should be considered beta-quality software.


Instead of saying "just doesn't work at all", you should say exactly what you are doing, what happens, and what you expect to happen. For example, in an Xcode project, you would say "I click the run button" and "there is no activity" but "I expected the simulator to open" or "I expected the app to run". For Xcode, you would also want to look at the console output if absolutely nothing is happening. You would also want to look at the build logs to see if there is an error.


You can go to the "Product" menu and choose "clean". If there is no change in behaviour, go to the "Product" menu, hold down the option key, and choose what now reads as "clean build folder".

Jun 2, 2016 9:16 PM in response to etresoft

Hi


I cleaned my project and cleaned my build folder and the problem still persists.


So here's more detail: My application is Timer, Stop Watch, and Alarm clock all rolled up into one. What I'm trying to do is allow the user to change the ringtone for Alarms. All was working till I started doing a big update to my application. All I did was move the change ringtone option to a different tab in my tabview. I didn't change any code but it doesn't work. I have a combobox where the user chooses the ringtone, then I have a play button so the user can listen to the ringtone to see if he likes it and then I have a stop button so he can stop playing the ringtone when he thinks he's heard enough. The problem is that the ringtone is not being played when I click the play button and I can't change the ringtone when I choose the ringtone in the combobox like I used to. When I click the play button Xcode does write something to the console, I'm not sure what it means though.


Hope this helps. Ask me anymore questions if you need to. I'm itching to get this problem fixed 🙂

Jun 2, 2016 10:23 PM in response to NathanaelC16

NathanaelC16 wrote:


When I click the play button Xcode does write something to the console, I'm not sure what it means though.

Hello NathanaelC16,

Wouldn't it be nice if there were people on the internet who would tell you what those messages meant.... if only they knew what it said. 😉


Interface Builder is pretty tightly integrated with code. You usually can't just move things around without re-wiring it all. Did you try to use Git to see what they changes were and/or revert them?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Swift code not working anymore

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.