chap 14 to 19 - Objective C Flashcards

2
Q

NSString

A

a class that holds strings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

NSLog()

A

is an objective-C function (not a method!) the format string is actually a method of NSString.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

NSArray

A
A class that holds a list of pointers to other objects.
NSArray *datelist = [NSArray arrayWithObjects:now, tomorrow, yesterday, nil];
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

NSArray methods

A

count – returns the number of items in an array.

objectAtIndex – returns the pointer that the array has stored at the index specified argument.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

fast enumeration

A

a type of loop that is extremely efficient way to walk through the items of an array.
for (NSDate *d in datelist){
NSLog(@”Here is a date: %d”, d);
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

MSMutableArray

A
similar to an instance of NSAray but you can add and remove pointers. It is a subclass of NSArray.
[datelist addobject:now];
[datelist insertObject:yesterday atIndex:0];
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

class is defined by what two files?

A

Header(interface) file – contains declarations of instance varibles and methods.

implementation file – this is where you write out steps for, or implement, each method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

instance method

A

Begins with a dash. - (void) setDoors:(int)anInt { … }

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

class method

A

Begins with a plus. +(int) wheels {
return 4;
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

@property

A

initializes get and set methods. @property int doors;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

self

A

a pointer to the object that is running the method. It is used when an object wants to send a message to itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

inheritance

A

a class inherits the instance variables and methods from the parent class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

@synthesize

A
sets get and set methods in the implementation file.
#import “Employee.h”
@implementation Employee
@synthesize employeeID;
@end
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

super

A

the super directive says, run this method, but start the search for its implementation at my superclass.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

object instance variables

A

points to another object and describes a relationship between two objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

object instance three catagories

A

Object-type attributes – a pointer to a value-like object like NSString.

To-one relationships – a pointer to a single complex object.

To-many relationships – a pointer to an instance of a collection class like MSMutableArray.

18
Q

object ownership

A

when an object has an object instance variable, the object with the pointer is said to own the object that is being pointed to. When an object has zero owners it deallocates itself.

19
Q

ARC, Automatic Reference counting

A

controls the owner count of each object. added in xcode 4.2