Coder Social home page Coder Social logo

ios-your-first-nslog's Introduction

Your First NSLog()

Objectives

  1. Open and navigate an Xcode project file.
  2. Print a message to the debug console during run time.

Introduction

In the previous reading we surveyed the layout of Xcode's tools. For this first lab, you're going to open and explore the simplest of Xcode projects and write your first line of code—calling a function that prints a string to the debug console. You'll need to navigate to the correct file, edit the code in the editor area, and watch for the printout in the debug console.

Instructions

1 — Open the provided Xcode project inside the lab's directory (open your-first-NSLog.xcodeproj). Explore the different areas of Xcode that the reading just discussed.

2 — In your Project Navigator, look for the file named FISAppDelegate.m (this is the "implementation" file for the FISAppDelegate class). Find the block comment inside the application:didFinishLaunchingWithOptions: method. It's here that you'll be writing your first NSLog():

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    /**
    
     * Hey! Write your code here! :D
     
     */
    
    // do not alter
    return YES;  //
}   ///////////////

3 — Type NSLog(@"Hello, World!"); on an empty line within this method—that is, inside the curly braces { ... } and before the return statement. Top Tip: This is a statement. Don't forget the ; ("semi-colon") at the end of your line! It ends your statement.

4 — Now hit R on your keyboard and your program will run. The iOS Simulator should launch into a blank screen. Nothing's wrong! We just haven't given it anything to display in this program.

5 — Look at your debugger output console viewer... your message "Hello, world!" should have printed! Here's a helpful image if you're having trouble:

Note: The spot in the code you were directed to add your NSLog() is the standard override point in the FISAppDelegate at application launch. We'll explain more of what the means later, but just remember that if you're directed to write code in the FISAppDelegate, it will likely be in this spot.

View Your First NSLog() on Learn.co and start learning to code for free.

ios-your-first-nslog's People

Contributors

fislabstest avatar markedwardmurray avatar misterfifths avatar sarogers avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios-your-first-nslog's Issues

Forks Are Apparently Identical

I have completed the directions for the lab "Your First NSLog" and I am trying to submit a pull request, but git hub is telling me that the original fork is identical to mine. This is even though I made the changes and commited them. I have tried to reset the code and commit again, but it doesn't work

light doesn't come up

I wanted to know if it is bug or it always takes long time to get the lights on after finishing one since it always take me long time to move on to the next because of the lights. Currently, I am stuck on "Your First NSLog" lab, and waiting for pull request light to come up.
Please advise.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.