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