Objective - C Basics Flashcards
interpolate syntax
NSLog(@”%@ %@”, @”Ari”,@”Ingber”);
creating an integer variable
NSInteger b = 2;
which has methods primitives or objects
objects only
4 basic primatives
NSInteger
NSUInteger
CGFloat
BOOL
comment styles
/* */ // //
what to look for when confronted with incompatible integer to pointer conversion
extraneous *
NSInteger Format Specifier
%li
NSUInteger Format Specifier
%lu
CGFloat Format Specifier
%f or %.nf, where n is the number of decimal places to display
BOOL Format Specifier
%d
syntax for calling a method and providing argument
ReturnType *captureVariable = [recipientObject methodNameArgument:argumentVariable];
xcode quick reference api
⇧⌘0
create a simple string using the “string literal” syntax
NSString *welcome = @”Ari is you!”;
reserve capital case for
Class names
use camel case for
methods and variables
if statement syntax
if (condition is true) {
run this code
}
syntax for creating empty mutable array
NSMutableArray *mEmpty = [[NSMutableArray alloc] init];
syntax for creating array w/ fixed element (immutable)
NSArray *instructors = @[ @”Joe”, @”Tim”, @”Jim”, @”Tom”, @”Mark” ];
4 elements of a method call (how to make a method call)
ReturnType *captureVariable = [recipientObject methodNameArgument:argumentVariable];
define method
a method is a behavior that an object can perform upon itself.