Some basic information about the development language for native iOS applications

Objective-C is a _____ of the C language

superset

Objective-C borrows much of its syntax from ______, one of the earliest object-oriented languages

Smalltalk

Objective-C binds methods and arguments at _____ instead of _______ time

runtime...compile

KVC

Key-value coding

KVO

Key-value observing

There are ____ fundamental building blocks in Objective-C

9

The nine fundamental building blocks of Objective-C can be dividing into 2 categories: _____ and _______

data...procedures

Data (like nouns) represent the information we are processing and in Objective-C this made up of the four elements of _____, _____, _____, and ______

C types, structures, enums, and objects

Procedures (like verbs) are processes that manipulate or transform data, and in Objective-C these 3 elements are _____, ______, and _____

C operators, functions, and methods

Two additional foundational building blocks of Objective-C distinct from data and procedure type foundations

Protocols and Categories/Extensions

Data types are divided into two main categories: _____ and ______

integer and floating-point

7 Common Integer data types

BOOL, char, short, int, long, long long, NSInteger

3 Common Float data types

float, double, CGFloat

Integer data types come in _____ and _____ variants

signed and unsigned

_____ data types can be both positive and negative, while ______ data types are always zero or greate

Signed...unsigned

True or false: In Objective-C, floats are more commonly used that doubles

true

What is the intention of the Objective-C command: typedef double NSTimeInterval;

Sets an 'alias' for double to better communicate the intent of a section of code.

Three main categories of more complicated data structures (beyond simple or 'primitive' data types)

pointers, arrays and structs

A variable that points to the memory address of another value

pointer

_____ allow indirect access and modification of a variable's value.

Pointers

Pointers are declared by placing a(n) ___ between the type declaration and the variable name

asterisk (*)

The process of setting or reading the value at an address pointed to by a pointer

dereference (dereferencing)

Placing a(n) ____ before a normal variable name gives it's address

ampersand (&)

What is the result of the following code: int a=10; int b=&a; b=15;

Changes the value of a to 15

Write an Objective-C statement to create an array named myList to hold 10 integers

int myList[10];

The first index in an array is valued at ____

zero

Write an Objective-C statement to create a literal array of integers named fibo containing 1, 1, 2, 3, 5

int fibo[ ] = {1,1,2,3,5};

C-style strings always end with a ____ character

null

C-style strings are stored in an array of _____

chars

True or false: char s1[5] = "test"; is a correct declaration/initialization for a C-style string

true (C appends a null value automatically)

Rather than using arrays in Objective-C, we often are able to use it's collection classes of ____, ____ and _____ with _____ for strings

NSArray, NSSet and NSDictionary with NSString

The most flexible C data type: ______

struct

A struct may contain multiple ____ consisting of ______ data types

fields...different

Create a CGRect object called r3 with an origin (top-left corner) of (100, 200), a width of 10 and a height of 20 using a struct literal formulation

CGRect r3 = {{100,200}, {10, 20}};

Create a CGRect object called r3 with an origin (top-left corner) of (100, 200), a width of 10 and a height of 20 using a helper function formulation

CGRect r3 = CGRectMake(100, 200, 10, 20);

If you are compiling an application with ARC, you _____ store Objective-C objects inside a _____

cannot...struct

ARC

Automatic Reference Counting

A compiler feature that provides automated memory management

ARC

____ provide a concise, elegant method for defining a discrete set of values

Enumerations

In the correct statement: int a = 5; 'int' is the ______, 'a' and '5' are the _______ and '=' is the ______. 'a' is known as the variable _______

datatype, operands, assignment operator, identifier

The 6 main categories of operators are: ____, _____, _____, ______, _______ and _______

assignment, arithmetic, comparison, logical, bitwise and membership

______ operators take a single operand

Unitary

_____ operators take 2 operands

Binary

a++; is an example of using a _____ operator

unitary

a+b; is an example of using a _____ operator

binary

Given: if(n % 2 == 0)isEven = YES; else isEven = NO; Rewrite using a ternary operator formulation

isEven = (n%2 == 0)? YES : NO;

In computer science, the mathematical concept of "order of operations' is known as the "order of ______"

precedence

The _____ function can be used to print a message to the console

printf( )

Symbol used to denote a placeholder in a format string

%

In C, all functions pass their arguments by ____, which means the compiler makes local copies of those arguments

value

In a home building analogy, a ____ is the blueprint and the _____ is the house

class...object

_____ is one of the main advantages of object-oriented code and allows objects to 'hide away' much of their complexity, operating at times like a proverbial 'black-box'.

Encapsulation

A _______ method is one that is likely to be unsupported in the future (although it may work in the present). It's use should be discontinued.

deprecated

The root class in Objective-C

NSObject

Objective-C methods are called using ____ _____

square brackets

In a format string, the place holder for an object is ______

%@

Instance variables are ________ in iOS if ________ are used

optional...properties

When creating a class header file, you begin with the _____ keyword and close with the _____ keyword

@interface...@end

When creating a class implementation file, you begin with the _____ keyword and close with the _____ keyword

@implementation...@end

True or false: When declaring 'id' variables, we do not use an asterisk since the 'id' type is already defined as a pointer to an object

true

Square bracket syntax for calling a method

[receiver message];

Consider: [NSString alloc]. 'alloc' is an example of a(n) ______ method rather than a(n) _______ method

class...instance

This symbol denotes a method as being an instance method

-

This symbol denotes a method as being a class method

+

Initializer method traditionally begin with the _____ prefix

init

Each class should have a ______ initializer, a single method responsible for performing all of the object's setup and initialization. Typically it is the initializer with the largest number of arguments.

designated

Property attribute that synthesizes accessors that are not thread safe

nonatomic

Property attribute that synthesizes both a getter and setter for the property

readwrite

Property attribute that synthesizes only a getter for the property

readonly

Property attribute that causes the setter to store a copy of the assigned value

copy

Property attribute that causes the setter to store a zeroing weak reference to the assigned value

weak

Property attribute that causes the setter to store a strong reference to the assigned value

strong

Property attribute where the setter stores the assigned value but does not perform any memory management. Should only be used for storing non-object data (int, float, etc). Objective-C objects should use strong or weak attributes instead

assign

Objective-C's protocols are really about communicating _____ _______

developer intent

Protocols are adopted by adding a _____- _______ list of protocols inside _____ ______ after the _______ _________ in a class's _______ block

comma-separated....angled brackets... superclass declaration....@interface

_____ allow you to add new methods to existing classes.

Categories

A ____ ____ is a situation where you free memory and then accidentally continue to use it

dangling pointer

A ____ _____ is where you forget to free up memory

memory leak

All objects are created on the _____

heap

ARC is susceptible to ____ _____

retain cycles

A retain cycle occurs when...

...two objects directly or indirectly refer to each other using strong references.

Zeroing weak referencing should be used for _____ and _____ to prevent inadvertent retain cycles

delegates ... data sources

Xcode sequence to convert non-ARC apps to ARC

Edit>Refactor>Convert to Objective-C ARC

Xcode sequence to examine an app for memory leaks or retain cycles

Product>Profile>Leaks>Profile

Given: [graduationParty addAttendee: @"Aunt Jane" withDish: @"deviled eggs"]; The 'receiver' is _______; the 'selector' is _________; the 'argument(s)' is(are) _______

graduationParty...addAttendee:withDish...@"Aunt Jane" & @"deviledEggs"

Given: a Java command: graduationParty.addAttendeeWithDish("Aunt Jane", "deviled eggs"); Re-write in Objective-C.

[graduationParty addAttendee: @"Aunt Jane" withDish: @"deviled eggs"];

To destroy an object, set the variable that points to it to _____

nil

Alternative code for: if(venue == nil){[organizer remindToFindVenueForParty];}

if(!venue){[organizer remindToFindVenueForParty];}

To create a "Command Line Tool" type project from a template you must choose _____ from the ______ menu in the template selection area

Application...Mac OS X

Correct the error: NSMutableArray items = [[NSMutableArray alloc] init];

Replace 'items' with '*items'

Correct the error: NSMutableArray items = [[NSMutableArray init] alloc];

Swap the locations of init and alloc

NSMutableArray *items = [[NSMutableArray alloc] init]

Add a semicolon to the end of the message

Rewrite as a 'foreach' construction:for(int i = 0; i < [items count]; i++){NSLog(@"%@", items objectAtIndex:i]);} Use an NSString called 's' as the variable.

for(NSString *s in items){ NSLog(@"%@", s)};

Please allow access to your computer’s microphone to use Voice Recording.

Having trouble? Click here for help.

We can’t access your microphone!

Click the icon above to update your browser permissions above and try again

Example:

Reload the page to try again!

Reload

Press Cmd-0 to reset your zoom

Press Ctrl-0 to reset your zoom

It looks like your browser might be zoomed in or out. Your browser needs to be zoomed to a normal size to record audio.

Please upgrade Flash or install Chrome
to use Voice Recording.

For more help, see our troubleshooting page.

Your microphone is muted

For help fixing this issue, see this FAQ.

Star this term

You can study starred terms together

NEW! Voice Recording

Create Set