Bummer! This is just a preview. You need to be signed in with a Treehouse account to view the entire video.
Objective-C Recap1:12 with Pasan Premaratne
We don’t need to know all of Objective-C to build our first app. Let’s recap what we learned about a basic construct - strings!
In the last video, we created a new Xcode project.
But before we jump in and
start making an app, let's refresh our memories on some Objective-C basics.
The first class we'll be using quite often in this project is NSString.
Which helps you store a string.
Think of this as a series of characters much like a banner at a party.
Let's create an instance of NSString.
To do this, we first start with the class name, which in this case is NSString.
This is followed by an asterisk, and then, the name of the object we're creating.
You can give your objects any name, and we'll call ours myString.
We're going to assign a String, using the equals operator.
So, let's add that after the name.
Next, we want to write out our string.
And the way we do this in Objective-C, is to start with an at symbol, and
a set of open quotes.
Followed by the string.
And then you end it with your closing quotes.
To finish this line of code we add a semi-colon to the end,
much like you would add a period or a full stop when finishing a sentence in English.
Why don't you give this a try in the next code challenge?
You need to sign up for Treehouse in order to download course files.Sign up