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

Predict button doesn't go away

I deleted all the code related to the button and the button itself in the storyboard but when I run it on the simulator it still appears.

When I press it it takes me to Crystal Ball/Crystal Ball/Supporting Files/main.m to this line of code:

return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));

I deleted it and it just made things worse so know I have no idea what to do.

5 Answers

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

If the app is stopping execution in main.m then it means that you have an error in your code. Doesn't seem like you are too far along so I would recommend starting a new project or download the project files from the downloads section below the video.

Oh well, thanks anyway.

Hi Conrad

Xcode often caches some of the resource files, such as .xibs or images. So you probably have an old version of the Storyboard on the Simulator, or on the Device you are running. It still contains that specific button, which contains the corresponding IBAction method attached to it. And obviously, if there is no such method in you View Controller class, the app crashes.

Just try to clean up the project (from menu: Product => Clean), and that should solve your problem.

I hope this advice helps you somehow :)

Still shows up. This getting annoying :-(

Ok, then try to Reset Content and Settings for the Simulator, and then try again.

Now the app doesn't even load. It takes me back to the same line of code.

Are you using a Developer Preview? If so they are still a little buggy in that area. If not check the hierarchy of your storyboard objects instead of the visual. Sometimes you delete the picture but the object still remains. Hope this helps

Yeh I looked at that and it's not there…

hate to say it but something very similar to what you're saying happened to me. I simply reset the project, (sad to do) then restarted. but because there is a zib file for each chapter you can simply use amits file from the video.

What is the log saying the error is? It will give you a very good idea as to where the exception was thrown.