Using XCode © 2013 Surajit A Bose De Anza College.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Getting started with MPLAB Launch MPLAB Set Toolbar as in the next slide by clicking the leftmost icon Open a new Source file by choosing [FILE][NEW] Type.
Introduction to the SPL Interpreter
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Creating a Program In today’s lesson we will look at: what programming is different types of programs how we create a program installing an IDE to get.
How to Debug VB .NET Code.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
© 2010 IBM Corporation IBM Experience Modeler - Theme Editor Installing Python Image Library Presenter’s Name - Presenter’s Title DD Month Year.
Software Development. Chapter 3 – Your first Windows 8 app.
Editing Java programs with the BlueJ IDE. Working environments to develop (= write) programs There are 2 ways to develop (write) computer programs: 1.Using.
Introduction to VBA. This is not Introduction to Excel We’re going to assume you have a basic level of familiarity with Excel If you don’t, or you need.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
A First Program Using C#
The NetBeans IDE CSIS 3701: Advanced Object Oriented Programming.
Microsoft Office 2003 Illustrated Brief Document Creating a.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
IE 411/511: Visual Programming for Industrial Applications
Author: Loh Jianxiong Christopher Editors: Chua Jie Sheng, Li Mengran, Peh Shao Hong, Oo Theong Siang.
CPS120: Introduction to Computer Science Compiling Your Programs Using Visual C++
Python From the book “Think Python”
How to Run a Java Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
How to Run a Java Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
9/2/ CS171 -Math & Computer Science Department at Emory University.
GumTree Development Environment Setup Windows Only Compatible with Eclipse 3.2 M3 (Last update: 16/11/05)
Downloading and Installing Autodesk Inventor Professional 2015 This is a 4 step process 1.Register with the Autodesk Student Community 2.Downloading the.
11/25/2015Slide 1 Scripts are short programs that repeat sequences of SPSS commands. SPSS includes a computer language called Sax Basic for the creation.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
IDLE An IDE for Python bundled with the program release Click on IDLE (Python GUI) in the Start menu under the Python program group  Get the IDLE Python.
Using This PowerPoint This PowerPoint presentation assumes your Computer Science teacher has provided you with the InstallingJava folder, which contains.
Author: Loh Jianxiong Christopher Contributions: Chua Jie Sheng, Li Mengran, Peh Shao Hong, Oo Theong Siang, Tong Chun Kit, Tania Chattopadhyay.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
Practical Kinetics Exercise 0: Getting Started Objectives: 1.Install Python and IPython Notebook 2.print “Hello World!”
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
Intoduction to Andriod studio Environment With a hello world program.
It is a digital recording of your computer screen. Screencasts are important in online teaching because it is a way of replacing traditional classroom.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Editing and Debugging Mumps with VistA and the Eclipse IDE Joel L. Ivey, Ph.D. Dept. of Veteran Affairs OI&T, Veterans Health IT Infrastructure & Security.
 CSC 215 : Procedural Programming with C C Compilers.
1 Using an Integrated Development Environment. Integrated Development Environments An Integrated Development Environment, or IDE, permits you to edit,
Digital Game Design ACST 3710 Your First Unity Program 1.
Introduction to iOS App Development Environment
The eclipse IDE IDE = “Integrated Development Environment”
Development Environment
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Eclipse Navigation & Usage.
Beginning C++ Programming
Computer Programming I
An Introduction to Computers and Visual Basic
Macrosystems EDDIE: Getting Started + Troubleshooting Tips
Unreal Engine and C++ We’re finally at a point where we can start working in C++ with Unreal Engine To get everything set up for this properly, we’re going.
How to Run a Java Program
1. Open Visual Studio 2008.
How to Run a Java Program
An Introduction to Computers and Visual Basic
Our Environment We will exercise on Microsoft Visual C++ v.6
Apple Xcode with Swift Demo
CSCE 206 Lab Structured Programming in C
Review of Previous Lesson
SETUP ALEXA APP Setup Alexa on your favorite device and control your smart device with the help of Alexa.
Executive Reports, Instructions and Documentation
Presentation transcript:

Using XCode © 2013 Surajit A Bose De Anza College

What is XCode? Apple’s free, full-featured IDE for Mac OS X Supports development in many languages: C, C++, Objective C, Java, Python, Ruby... As with all IDEs, includes a text editor, a debugger, and a compiler

Why XCode? (1 / 2) Extremely modern: current versions use the LLVM compiler with Clang, providing support for the C11 standard Clean interface, very little overhead, launches and runs fast Good for coding apps for the iPhone

Why XCode? (2 / 2) Less buggy and more professional than CodeBlocks Less bloated than Eclipse... and, of course, if you have a Mac, you can’t use Microsoft Visual Studio

How to get XCode Free with Mac OS X 10.7 Lion or above Under the Apple menu, launch App Store Then search for XCode and download it

How to get XCode No Developer Connection account needed was needed for earlier versions of the OS Current version is (as of Nov 2012)

Creating a Project Launch XCode Under File, choose New => Project In the template window that opens, click Application under OS X in the left-hand bar

Creating a Project

Then click Command Line Tool

Creating a Project

The next window asks for the name and type Give the project a name and make sure the correct type is selected (usually C or C++ for De Anza CIS classes)

Creating a Project

The next window asks you where you want the project to be saved Navigate to the appropriate directory, create a folder if desired, and save the project Voilà. A big, scary project window opens

Creating a Project

Don’t worry. Just click on main.c / main.cpp

Creating a Project

Neat. XCode gives you the entire hello world program with nice syntax highlighting There is a guide to 81 characters so you can ensure that long lines of code wrap properly when you need to print

Creating a Project

Change Line Endings for compatibility with Windows Otherwise professors or teammates will complain that your code is all one long line

Creating a Project

Then free up valuable real estate by closing the Utilities bar. To do this, click on the leftmost of the three View icons on the top right of the menu bar

Creating a Project

Run the program by clicking on the Run button in the top left of the menu bar The output window opens up below the code editing area

Creating a Project

You can also see the last output by clicking on the middle of the three View icons on the top right of the menu bar

Creating a Project

Replace the “hello world” program’s text in main with your own text to create your program (in case you were wondering) That’s it! That’s how to create a new project in XCode To continue work on an existing project, double-click its.xcodeproj file or choose File => Open or File => Open Recent

Compile Errors XCode highlights compile errors with a red circle in the left margin of the code editing window Here is what happens if I leave out a required semi-colon in the Hello World program

Compile Errors

You can click on the red circle with the mouse pointer to see details

Compile Errors

Warnings XCode indicates warnings with a yellow triangle in the left margin of the code Again, you can click on the triangle for details Here is what happens if I declare an unused variable

Warnings

Debugging XCode offers all necessary debugging features For the purposes of demonstration, let us look at a simple swap program Note: The lack of comments is deplorable (and you will lose points for it), but I wanted the program to fit on one screen

Debugging

Set a breakpoint anywhere by clicking on a line number. Breakpoints are indicated by a blue symbol that appears on the line number When the program runs and stops at the breakpoint, the current instruction (not yet executed) is highlighted in grey You can see what the values of various variables are

Debugging breakpoint variable values

Debugging You can then continue (step into, step over, etc) by clicking on the symbols

Debugging From left to right: Continue Step over Step into Step out

Debugging As you “step into” the next instruction, you can see the values of the variables update Note that with pointers you can click on the triangle to see the dereferenced values

Debugging

This is very useful to see what is going on with your code

File I/O Apple’s philosophy is that the user doesn’t need to know where actual files are (cf. iTunes, iPhoto, iMovie, etc) This is very irritating in XCode. I/O files need to be in the same directory as the executable, but where’s executable? Here is how to find it

1. Make sure the Navigator is showing 2. Click on the Folder icon 3. Click on the Products folder to see the executable

4. Control-Click on the executable and choose “Show in Finder”

File I/O After all this rigmarole, the folder that has the executable will open in the Finder This is where the swap program was on my computer: /Users/surajit/Library/Developer/Xcode/ DerivedData/test_product- adzjubnqtxjalfcrtlxcqusmphix/Build/Prod ucts/Debug/test_product. Note that Library is an invisible folder Way to go, Apple

File I/O Anyway, after this Sherlock Holmes feat of detection, you can finally put the input files where they need to be for the program to access them Output files are in this directory by default

Conclusion Barring the really stupid, opaque handling of build and debug directories, XCode is an excellent IDE It is far superior to Visual Studio in terms of compliance to standards (plus, it shows line numbers by default— imagine that) Use it especially if you plan to develop apps for the iPhone