How to Create an iOS App
How to Customize Xcode for Your iPad App
How to Add a Button to Your iOS App

Using Live Issues and Fix-it

The Apple LLVM compiler engine wants to be your best friend, so Live Issues continuously evaluates your code in the background and alerts you to coding mistakes. Before this feature came along, you had to build your app first; this new way saves lots of time and effort.

But not only is Live Issues happy to point out your mistakes, Fix-it will also offer (when it can) to fix the problem for you. Clicking the error displays the available Fix-its, such as correcting an assignment to a comparison, repairing a misspelled symbol, or appending a missing semicolon.

With a single keyboard shortcut, you can instantly have the error repaired, and you can continue coding. Fix-it marks syntax errors with a red underline or a caret at the position of the error and with a symbol in the gutter.

For example, in the figure, the semicolon is missing after the [super viewDidLoad] statement. (Notice the error indicator — the red circle with exclamation point — in the Activity viewer, your Go To place for showing status messages, build progress, and errors.) Pressing Return will automatically fix this problem. This is a very useful feature and will cut down your debugging time significantly (especially if you actually use it).

image0.jpg

Although Xcode and the compiler working together are very good at giving you warnings and errors, sometimes they're a little slow on the uptake when you actually get around to fixing the problem. So don’t be surprised by random warnings and errors, especially if the compiler for some reason can’t find the header file.

If you see a warning or error that you’re just sure you’ve fixed, you can click the Run button. Xcode and the compiler will reset, and the warning will go away. (Unless, of course, it was right all along and you hadn’t fixed the problem.)

  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
How to Add the Events Controller to Your iOS App
How to Create an Outlet for the Map Controller in Your iOS App
How to Customize Your iOS App Table View for the iPad
How to Use Inspector and Quick Help Pane for iOS App Development
How to Use a Navigation Controller in the Master View for Your iOS App
Advertisement

Inside Dummies.com