chap 12 to 14 - objective-C Flashcards
message send
always surrounded by square brackets.always has two parts:
- a pointer to the object that is receiving the message.
- the name of the method to be triggered.
objects in memory
framework
a library of classes that you use to write programs.
method
a function triggered by a message.
object
holds data like a structure except that it also contains a set of functions that act upon that data.
class
describes a particular type of object. This description includes methods and instance variables where an object of this type stores its data. You ask a class to create an object of its type for you on the heap. We say that the resulting object is an instance of that class.
message send
always surrounded by square brackets. always has two parts: a pointer to the object that is receiving the message. the name of the method to be triggered.
id
a pointer of some kind of Objective-C object. id delegate; no asterisk needed. id implies the asterisk.
class method
you cause the method to execute by sending a message to the class. the method returns a pointer to an instance of that class. NSDate *now = [NSDate date];
instance method
You cause the method to execute by sending a message to an instance of a class. double seconds = [now timeIntervalSince1970];
alloc
class method that returns a pointer to a new object that needs to be initialized. Pointer is then used to send the new object the message intit. NSDate *now = [[NSDate alloc] init];