Level 7 Level 9
Level 8

X-Code/Objective C review


104 words 0 ignored

Ready to learn       Ready to review

Ignore words

Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.

All None

Ignore?
true
True or false: Beginning with iOS4, applications no longer terminate when the user presses the Home button
int main ()
Which is the proper definition of the main function in C?
printf("Hello World ");
How do you call the print function in C?
}
#include <stdio.h>
_______unstable = _______;
int unstable = 25;
float radius = 14.5;
Create a float variable named 'radius' with the value '14.5' using C
#include <stdio.h>
Using C add a print statement that will print the words "There are 7 days in a week".
%d
What special formatting characters are used in C within a string to print variables in appropriate ways?
A Statement
A line of code that ends with a ";" is called...
Javascript, Python, PHP, C#, C++, Java, PERL
What other programming languages are based in C?
What are some examples of "short-cut" notation in C?
a = a * b --> a * =b
Array
Represents a list of data
int magic_numbers[] = {3,
numbers: 3, 6, 9 12. Write a print statement that will print "3 is a magic number."
letters[1];
char letters[] = {"a", "b", "c", "d"};
for(int i=0; i<5; i++){}
Write a valid for loop that will execute exactly 5 times.
Do-while loop, For loop, While loop
Name the three types of looping constructs in C
the following: Array real_numbers is __ bytes.
printf("Array real_numbers is %ld bytes./n", sizeof
Last
When is auto-incrementing done within a code block?
While Loop
repeatedly executes a target statement as long as a given condition is true.
Do While
a variation of the While Loop in which the application is written "backwards" with the "Do
Conditionals
re-route the flow of information through your program.
Else-If Statements
Allows you to string if statements together
Switch Statement
In the switch statement, a value is compared a set of known values, called "cases". When
pointer
a variable whose value is the address of another variable, i.e., direct address of the memory location
*
Symbol often denoting a 'pointer'
Dereferencing a pointer means...
getting the value that is stored in the memory location pointed by the
&
Symbol that indicates the address of a variable
char *cookies;
in your array
int *myEven;
in the notes).
struct
declaration that defines a list of variables to be placed under one name in a block of memory, allowing
Definition --
general syntax to define a struct and then declare the associated variable
field
each individual type of data within a struct
Composition
the ability of an object in Objective C being "composed of" various other objects
Object-oriented programming (OOP)
programming language model organized around objects rather than "actions"
main() function
serves as the root of an Objective-C application. Looks like:
.h
extension for interface file
.m
extension for implementation file
header / interface file
Used to define a list of all methods and properties a class uses
Class
Describes the behaviour and properties common to any particular type of object. You need to both allocate and initialize an object to be able to use it.
Subclass
Inherits all the behaviours and properties defined by the parent. Can define its own additional behaviour and properties or override the behaviour of the parent class.
inheritance
allows a class to be defined that has a certain set of characteristics (such as methods and
:
Symbol used for inheritance
properties
Setters and Getters can be replaced by _______ in Objective C to make the code less bulky and simpler.
NSArray
An example of a common collection data type
immutable
cannot dynamically add or remove items
@[ ]
Arrays can be defined as literals using the _______ syntax in Objective C
NSArray *arrayName = [[NSArray alloc]
Syntax to declare, allocate, and initialize an array in Objective C
for (NSString *string in arrayName) {
Syntax to use a 'for' loop in Objective C
Syntax to access items in an array:
NSString *newVariableName = arrayName[# of position desired in array];
NSMutableArray
Class that creates an array capable of being changed after it is create
Syntax for NSMutableArray
NSMutableArray *arrayName = [[NSMutableArray alloc] init];
[arrayName removeObjectAtIndex:#toRemove];
Syntax to remove an item from the array:
framework
is a reusable software platform for accelerating the development of an application. Provides basic
NSNumber
wrapper class for number data types, such as int, double, and float. Can be added to an array.
NSString
The '@' symbol is shorthand for creating one of these
String Literal
The easiest way to declare and initialize a string / Literally defines a string and its contents.
Concatenation
Joining two or more strings into one. Uses the method stringByAppendingString
NSObject
Master class in iOS
Get method
gets the value of an instance variable
Set method
sets the value of an instance variable
@property
replaces the set and get method for each instance variable. Has two attributes: atomic/nonatomic
Atomic
the default property attribute, meant for a multi-threaded environment; Multiple threads/processes can be
Non-Atomic
attribute that allows for faster access to a property in a non-multi-threaded environment
strong
Attribute that informs the system that the object referred to needs to be kept around and not discarded from memory
Weak
Child --> Parent relationship; specifies a non-owning relationship to the destination object, the system
tableView
property of the UITableViewController connects to the table view displayed on the screen
protocol
a list of methods.
UITableViewDelegate
Protocol used to figure out how the data is displayed in a table view such as row height,
UITableViewController
Subclass of tableViewController; Creates a controller object that manages a table view;
objectAtIndex
allows us to choose which object within the array we want to use, by calling on its index location
dequeueReusableCellWithIdentifier
Method that helps manage memory efficiently by reusing table view cells
cellForRowAtIndexPath
Asks the data source for a cell to insert in a particular location of the table view;
JavaScript Object Notation (JSON)
a data format that is easy for computers to parse (separate into sections)
model-view-controller pattern (MVC)
proposes three main components or objects to be used in software
model
In the MVC design pattern for iOS apps, this aspect provides the underlying data and methods that offer information to the rest of the application
view
an object that draws content in a rectangular area and handles events caused by user's touches.
controller
In the MVC design pattern for iOS apps, this aspect is responsible for receiving user input and acting accordingly, and serves as a 'bridge' between the other two components. It is the backbone of the app.
Single Responsibility Principle
Every class should have a single responsibility
NSURL
Class that allows URL management
NSData
method that will download data from a previously created URLobject into the NSData object; allows you to
Serialization
taking a stream of data that is in a machine-readable format and storing or streaming that data
Song *countrySong = [[Song alloc] init];
Create an instance of Song with alloc and init.
Any assumptions you make will always be
What assumptions can you make about downloading data from the internet?
By accessing the property
How do you get access to the current view controller in a Navigation stack?
viewControllers
Property of the navigation controller that holds an array of all its view controllers
Navigation Controller
convenience class that presents a navigation toolbar to manage hierarchal data and its
Cloud
servers on the internet where data and/or functionality are stored
UIImagePickerController
iOS controller that lets you capture photos and video
window
a container for app's visible content.
UIViewController
The superclass for WelcomeViewController
Convenience Constructor
Allows you to declare the variable and load value in the same step; Method that performs
(void)
the return type for functions that don't return anything
initWithInt
Returns an NSNumber object initialized to contain a given value, treated as an int
UITableViewCell
Defines the attributes and behavior of the cells that appear in UITableView objects; Return type
identifier (segue)
a string that an application uses to distinguish one segue from another, readonly
segue
a transition between scenes
prepareForSegue:sender
intercepts a segue once it has been triggered so that it can pass any needed data to the
NSIndexPath
represents the path to a specific node in a tree of nested array collections; Uses two properties
NSJSONSerialization
used to parse JSON and store it in an NSDictionary object.
Super
refers to the parent class within an implementation
self
Way to refer to an object within its own methods
True
you may also use @property alone to implicitly declare a matching instance variable
Model
information to the rest of the application
Controller
accordingly, and serves as a 'bridge' between the other two components. It is the backbone of the app.