Swift For Dummies
Book image
Explore Book Buy On Amazon

After you have created a new Swift project from a template and are chomping at the bit and ready to get going — run the app. When it runs, you should see a map when iOS Simulator is in landscape mode (use Hardware→Rotate Right/Left to get to the landscape view).

If the app doesn’t run from the basic template, it won’t run for your further additions.

If your app doesn’t run, try some of the solutions in the following list, ordered from simple to more complex. Before considering these options, however, take this one very basic step: If you have an error message, read it and see if it describes a problem that you can solve.

Failing that, run Console (launch it from Applications→Utilities→Console) and look for recent messages that may relate to your app’s problems. There may not be messages of either type, or you may not understand them. In either case, you can proceed with the solutions listed here:

  • Try again: For any number of reasons, your second try may succeed. You may have made a mistake the first time in one way or another, or some components of the test (most often iOS Simulator) may need more time to launch. There are two parts to “try again”:

    Try to run the app again using Xcode and iOS Simulator.

    Create a new project from the Xcode template and try to run that one.

  • Check your components’ versions: Ideally, you are using the latest release versions of OS X and Xcode. If you are using pre‐release beta versions, try again with the release version.

  • Look at Apple Developer Forums: Most of this area is reserved for registered developers, but even so, it’s worth checking to see what you can get to. Use the search tools, because you might find your answer mentioned in passing in a totally unrelated post. Searching on the text of an error message you have found is always a good start.

  • Search the web: Use a web browser to search on the error message. Check the date on postings you find because they may be out of date and cause you to waste time. (That also applies but to a lesser extent with Apple Developer Forums because they are moderated.)

  • Try another template: Try one of the other built‐in Xcode templates to see if you can build and run it. This may narrow down your problem.

  • Use a technical support incident: If you are a registered Apple developer, you typically get two technical support incidents each registration year. (Note that the year begins and ends on the anniversary of your registration, rather than the calendar year.)

    You have separate registrations for iOS and OS X, so if you are registered for both programs, you have four technical support incidents that you’ve already paid for. Many developers hoard their incidents in case they need them, but remember that you’ve already paid for them (and you can buy more in packages of two for $100). Be aware that you can’t use technical support incidents for pre‐release software, so make certain you’re using the release versions of OS X and Xcode.

  • Contact other developers: Check sites to find a mutual help group near you. Of course, you’ll probably discover that a group met yesterday and will meet for the next time in two months, but even so, it’s worth a shot.

  • Social media to the rescue: As long as you’re not dealing with pre‐release software from Apple that’s covered by non-disclosure, search and then post a message on tools like Facebook or LinkedIn to see if someone else has had the problem. If the problem really isn’t your fault (this happens mostly with pre‐release software) you may discover other people who have come across this problem (and maybe solved it).

  • Tomorrow is another day: Create a new Xcode project and test it from the beginning . . . tomorrow. In the meantime, get some rest and clear your mind. Do the same for your Mac (that is to say, shut it down and then restart it).

    Shutting down rather than just restarting may help you get past network issues that may be getting in your way. Particularly if you are using a shared network disk, you may be encountering some kind of network problem that a total restart will either solve or clearly identify.

About This Article

This article is from the book:

About the book author:

Jesse Feiler is a developer, consultant, and author specializing in Apple technologies. He is the creator of Minutes Machine for iPad, the meeting management app, and Saranac River Trail and is heard regularly on WAMC Public Radio for the Northeast’s The Roundtable.

This article can be found in the category: