The primary root object for the Foundation framework is called...
Given an object with an instance variable called numerator and...
The id data type can be used for any object type; it is a generic...
When the retain count on an object reaches 0, the object gets sent a...
A respondsToSelector: message can be sent to an object to see if it...
You own an object that you copy
The conformsToProtocol: method can be used to see if an object belongs...
You can add more than one category to a class.
In general, you are responsible for releasing an object created with...
In general, when you add an object to a Foundation array, its retain...
In general, when you add an object to a Foundation array, its retain...
In the general form of the for statement...
The @private directive restricts access to instance variables to...
When you use alloc to create a new object, you should release the...
What file name extension is used for Objective-C code?
A newly allocated object should always be initialized
A class gets sent an initialize message when the class gets referenced...
An instance of a class is known as
The following:
@interface Fraction (MathOps)
...
@end
What is wrong with this sequence of code?
sum = 100;
int sum;
It's okay to override init, but not considered wise to override...
In general, you are responsible for releasing an object created with...
The method names print and print: refer to two different methods.
The dealloc method is automatically called when an object's memory...
Web-based apps require users to connect to the website that host the...
If s is an NSString object, the expression
[s length] - 1
If you omit a break statement at the end of a case in a switch...
A static variable will retain its value from one method call to the...
What is the value assigned to m?...
The first character in a string has an index number of 1
The main difference between NSString and NSMutableString objects is
A class definition does not contain
If x is an integer, the expression...
What is the value of sum after executing this loop:...
Data encapsulation means
In general, this sequence...
If you override a method in a subclass there is no way to invoke the...
A web-based app runs the same way as a native iPhone apps
What is the value of sum after executing this loop:...
In general, a class should never own its own objects
A class can have more than one parent class.
What is wrong with this code?
int i, j, sum;
i = 100;
sum = i + j;
A leading + sign at the start of a method indicates
Which is an example of an invalid variable name?
Given the following method declaration in the interface section, what...
Sending an autorelease message to an object has the effect of...
The removeObject: method
What is the output from this code?...
The line
id <Painting> myObject;
Sending an autorelease message to an object has the effect of...
If you divide a float by an int the operation is done as an integer...
The sequence...
The statement...
The following:
#define kStudents 50
Given i = 15, what is the value of this expression:
i / 2.0
If x is an integer, the expression
! x
What is wrong with this line of code?
Int Sum;
If I write this statement...
What is the value of s after executing this loop:...
Given...
All of the methods in a category must be implemented
If you write this outside of any method or function:...
In general, when you use the removeObjectAtIndex: method to remove an...
A dealloc method should
What is the value of z after executing this sequence (check...
The iPod Touch supports garbage collection
If you override dealloc, you should first send a dealloc message to...
The difference between #import and #include is
The following...
This code sequence...
This directive...
What is true about the local variable counter if this statement is...
A category can be used to add new instance variables to a class.
Sending a release message to an object always causes the memory...
Given
int i = 15;
the expression
(float) i / 2;
Which value is not equivalent to the others?
The continue causes execution to leave the current loop and to...
NSInteger is
Given...
Which line starts the definition of a class called XY whose parent...
Given...
In order to make sure you release any instance variables you own, you...
Int, float, and char are reserved words and examples of Objective-C...
Can you send a message to self from inside main?
In order to make sure that an object is not inadvertently released...
If x and y are integers, the statement...
The difference between enclosing a file name in <...> and...
Once you create a number object, you can't change its value
Sending a release message to an object always causes the memory...
If you create a new NSString object with the stringWithString: method,...
What can you say about the indicated statement?...
What will be the value of y?...
Given
int i = 15;
the expression
(float) (i / 2);
If you want to return an object back to the caller of your method and...
Given that i = 11, what is the value of the expression
i % 2.0
When you drain an autorelease pool all objects that have been sent...
If width is an instance variable, then this line in the interface...
A local variable that has no default initial value and does not retain...
When you drain an autorelease pool all objects that have been sent...
If you want to return an object back to the caller of your method and...