Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Notes: Objective-C Syntax
Date: October 10, 2014
Description: Described NSLog(), strings, and function instantiation.
NSLog(): Similar to a print statement, or "cout" in C++. Prints data given within the parentheses
to the XCode Console.
Example: NSLog(@"Doing okay thus far"); prints "Doing okay thus far"
Strings: Data type that holds multiple characters. In Objective-C, strings are made by putting an
"@" before double quotation marks where the value of the string is written.
Example: @"Hello", if instantiated with a variable, would hold the value "Hello"
Function instantiation: Started with a dash, followed by the (return type), followed by the function name.
Brackets must be around the code for the function, as with just about every other language.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.