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 trialM S
224 PointsWhen I try to run the simulator, my simulator turns black. What is happening and how do I fix it?
Someone please help me
M S
224 Points-OK. Well, when I try to run it, Xcode switches to a file that says AppDelagate.swift. It has a line of code that is highlighted, so I'm guessing that that is the error. The line of code says:
class AppDelegate: UIResponder, UIApplicationDelegate {
-Next to it, there is a warning that says:
Thread 1: signal SIGABRT
-FYI, i put in the lines t separate what Xcode says and what I'm saying. I also put dashes where I'm speaking just so you don"t get confused.
3 Answers
Stephen Whitfield
16,771 PointsCopy and paste your code here so we can help if you haven't still figured it out.
M S
224 Pointsok, so this is what is says:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
return true
}
What should I delete? I tried deleting:
-> Bool { // Override point for customization after application launch. return true }
I got a message saying:
"Expected '{' in body of function declaration."
Do you know what to do?
Stephen Whitfield
16,771 PointsThat block of code is fine. Don't delete anything. I'd also suggest going through the Swift courses to see what that "-> Bool" means and why that method is returning 'true'.
Are you working with a Storyboard? If so, go to your General settings tab and scroll down to where it says "Main Interface". Click on the down arrow and choose the view controller that serves as your Main view controller in your project. See if that works.
Stephen Whitfield
16,771 PointsAre you running the app with a Storyboard? If so, go to the appDelegate and make sure there is nothing in the "didFinishLaunchingWithOptions" method. There may be some boilerplate code that creates a window, sets its background color and makes it visible. Erase that and run the app again.
M S
224 PointsUm, I think that I am running the app with View Contoller. Should I still check or is there a different option?
M S
224 PointsWhen I delete some thing that says
-> Bool { //overide point for customization after application launch. return true } | Next, I get an eror message that points to the "a" in the "func application(application..." the a is the one with the line over it. The error says, "Expected '{' in body of function declaration."
Do you know what to do?
Craigg Bergeron
7,320 Pointssame problem was happening with me i deleted the button and erased the code then added a new button and re linked it then started working properly
Kevin Hamil
8,203 PointsKevin Hamil
8,203 PointsYou should be as specific as you can about the issue you're having and post your code to help us help you. Without seeing what is happening in your code, it's hard to guess what it could be.