iOS 5 App Development 2 MCQs

iOS 5 App Development 2 MCQs

These iOS 5 App Development 2 multiple-choice questions and their answers will help you strengthen your grip on the subject of iOS 5 App Development 2. You can prepare for an upcoming exam or job interview with these 20 iOS 5 App Development 2 MCQs.
So scroll down and start answering.

1: Talk about BOOL variables.

A.   Controls how the model is presented onscreen.

B.   NO is zero; YES is anything else.

C.   Properties; instance variables

D.   'Keep this in the heap as long as someone else points to it strongly. If it gets thrown out of the heap - set my pointer to it to nil.'

2: What is a reason to write our own setter?

A.   If it's in the header file - it's public. To make some private variables - you can put a private interface section at the top of an implementation file.

B.   [[UIView alloc] initWithFrame]

C.   NSArray; no - it's immutable.

D.   Argument validation.

3: What is the fundamental design pattern of iOS development?

A.   Instance method; class method.

B.   NSObject

C.   MVC - for model-view-controller

D.   Introspection - with the class method 'class'

4: What is the word for checking/verifying the type of an object?

A.   6. Talk about NSString

B.   Yes. As much as it wants.

C.   Never!

D.   Getter and setter methods.

E.   Can handle any language because it uses Unicode.

5: Is NSArray mutable?

A.   Points - to achieve device-independence

B.   My rectangle in my superview's coordinate space

C.   Instance method; class method.

D.   No. Use NSMutableArray - which is a subclass of NSArray.

6: The basic steps in custom drawing.

A.   1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.

B.   Nothing happens - and nil is returned.

C.   UIWindow

D.   At runtime.

7: How to tell if an object is of a particular class? (Write a line of code)

A.   The document; possibly a database.

B.   Option-click; option-double-click

C.   [Object isMemberOfClass:[Classname class]]

D.   Action

8: How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)

A.   Instance variable (ivar) or 'backing variable'

B.   Two floats - for width and height

C.   [Object isKindOfClass:[Classname class]]

D.   Properties; instance variables

9: Does a view own the data it displays?

A.   [Object isKindOfClass:[Classname class]]

B.   No - it gets the data from the controller.

C.   NSObject

D.   The document; possibly a database.

10: How can I find out the class of any object? Give a line of code.

A.   Getter and setter methods.

B.   Don't use id for a pointer. Use the actual type pointed to. It allows the compiler (but not the runtime!) to help find bugs.

C.   Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.

D.   Class XX = [Object class]

11: List the iOS hierarchy from top to bottom.

A.   No. It's fine.

B.   Id; an object pointer

C.   Cocoa Touch - Media - Core Services - Core OS

D.   Zero/nil

12: What does a view (UIView) represent?

A.   NSArray; no - it's immutable.

B.   A rectangular area

C.   Points - to achieve device-independence

D.   Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.

13: What is in the model?

A.   Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.

B.   Zero/nil

C.   The document; possibly a database.

D.   Two floats - for width and height

14: What does the controller do?

A.   No. Use NSMutableArray - which is a subclass of NSArray.

B.   NO is zero; YES is anything else.

C.   Controls how the model is presented onscreen.

D.   Internal origin and size. Use this inside a view

15: How to tell whether an object implements a particular method? (A line of code)

A.   Action

B.   [Class respondsToSelector:@selector(aMethod)]

C.   (1) We can validate (e.g. bounds-check) any sets done by a subclass. (2) We can lazily instantiate - so things only get created if and when they are needed.

D.   NO is zero; YES is anything else.

16: How to instantiate an object?

A.   The document; possibly a database.

B.   Outlet; Action

C.   1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];

D.   @interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end

17: When is it OK to call drawRect: directly?

A.   Never!

B.   On left side - is calling the setter - and on the right side - is calling the getter.

C.   Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.

D.   NSData

18: How is ARC done?

A.   To zero; so pointers are nil.

B.   NSArray; no - it's immutable.

C.   The compiler adds code to count references.

D.   NSSet; no - it's immutable

19: ________ implements the getter and setter. But we can always__________

A.   [Class respondsToSelector:@selector(aMethod)]

B.   @synthesize; write our own getter and/or setter.

C.   NO is zero; YES is anything else.

D.   1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];

20: Some controllers have ____________ as their views.

A.   [Class respondsToSelector:@selector(aMethod)]

B.   Other MVC trios.

C.   'Keep this in the heap until I don't point to anymore.' I won't point to it anymore if I set my pointer to nil - or if I am removed from the heap because no one points strongly to me.

D.   Never!

21: How many superviews does a view have? How many subviews?

A.   Constant NSString

B.   [Object isKindOfClass:[Classname class]]

C.   'Keep this in the heap until I don't point to anymore.' I won't point to it anymore if I set my pointer to nil - or if I am removed from the heap because no one points strongly to me.

D.   One; zero to many

22: A _______ is how a view notifies the controller of something - for example - a button press.

A.   NO is zero; YES is anything else.

B.   One; zero to many

C.   Action

D.   Don't use id for a pointer. Use the actual type pointed to. It allows the compiler (but not the runtime!) to help find bugs.

23: The single-view template in Xcode does not...

A.   Create a model

B.   Id

C.   IOS; when the view is loaded.

D.   Designated initializer.

24: ______ is a pointer to any object.

A.   Two floats - for width and height

B.   Strongly.

C.   Argument validation.

D.   Id

25: What about controller talking to the model?

A.   @synthesize; write our own getter and/or setter.

B.   An outlet.

C.   Option-click; option-double-click

D.   Yes. The controller knows everything about the model.

26: What is the makeup of a CGRect?

A.   A CGPoint and and a CGSize

B.   Dash - Plus sign.

C.   Two floats - for width and height

D.   Strongly.

27: The controller is always a subclass of...?

A.   [[UIView alloc] initWithFrame]

B.   UIViewController.

C.   1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];

D.   Two floats - for width and height

28: Can the controller talking to the view?

A.   NSArray; no - it's immutable.

B.   No...but it has 'a way' to notify the controller to come ask for fresh data.

C.   Right-click on view - or even a subview like a button.

D.   Yes. As much as it wants.

29: ______ is a pointer

A.   Never!

B.   To zero; so pointers are nil.

C.   Action

D.   Self