NAME

Question types


Start with


Question limit

of 14 available terms

Print test

14 True/False questions

  1. @property example@interface Fraction : NSObject

    @property int numerator, denominator;

          

  2. Synthesized Accessor Methods@implementation Fraction

    @synthesize numerator, denominator

    Creates four methods:
    numerator
    setNumerator
    denominator
    setDenominator

          

  3. The self keywordUse this keyword to refer directly to the receiver of the current message.

    Use it inside a method

    Inside the add: method
    [self reduce]
    this would reduce the current object

          

  4. Dot notation should only be used for properties. You should use the brackets for methods.header (.h) [interface]
    implementation (.m)

          

  5. The static keywordUse this keyword to refer directly to the receiver of the current message.

    Use it inside a method

    Inside the add: method
    [self reduce]
    this would reduce the current object

          

  6. Comparison code<> system files
    "" local files

          

  7. The interface file (.h) tells the computer what a Fraction class looks like: it has six instance methods. The first three methods don't return a value. The next two return an int, and the last one returns a double. The setNumerator: and setDenominator: methods each take an integer argument.Note

          

  8. Method with multiple argumentsUsed to access properties:
    [myFraction numerator]
    is the same as
    myFraction.numerator

    General format
    instance.property

    Assign values
    instance.property = value

          

  9. local variablesvariables that can only be accessed from within the method that they are defined.

    - (void) reduce
    {
    int u = numerator;
    }

    You must set local variables to a value before you can use them.

          

  10. importing files[myFraction setNumerator: 1];
    [myFraction setDenominator: 3];

    same as..

    myFraction.numerator = 1;
    myFraction.denominator = 3;

          

  11. @synthesize example@interface Fraction : NSObject

    @property int numerator, denominator;

          

  12. Two files created when you make a new classAs of Objective-C 2.0, you can have your setter and getter methods (collectively known as accessor methods) automatically generated for you
    1. create the @property in the interface file
    2. create the @synthesize in the implementation file

          

  13. You don't need to use the @synthesize directive. If you don't, the instance variables will have an _ as the first character of its name.As of Objective-C 2.0, you can have your setter and getter methods (collectively known as accessor methods) automatically generated for you
    1. create the @property in the interface file
    2. create the @synthesize in the implementation file

          

  14. The Dot OperatorUse this keyword to refer directly to the receiver of the current message.

    Use it inside a method

    Inside the add: method
    [self reduce]
    this would reduce the current object