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.
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.'
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.
A. Instance method; class method.
B. NSObject
C. MVC - for model-view-controller
D. Introspection - with the class method 'class'
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.
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.
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.
A. The document; possibly a database.
B. Option-click; option-double-click
C. [Object isMemberOfClass:[Classname class]]
D. Action
A. Instance variable (ivar) or 'backing variable'
B. Two floats - for width and height
C. [Object isKindOfClass:[Classname class]]
D. Properties; instance variables
A. [Object isKindOfClass:[Classname class]]
B. No - it gets the data from the controller.
C. NSObject
D. The document; possibly a database.
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]
A. No. It's fine.
B. Id; an object pointer
C. Cocoa Touch - Media - Core Services - Core OS
D. Zero/nil
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.
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
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
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.
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
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
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
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];
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!
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
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.
A. Create a model
B. Id
C. IOS; when the view is loaded.
D. Designated initializer.
A. Two floats - for width and height
B. Strongly.
C. Argument validation.
D. Id
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.
A. A CGPoint and and a CGSize
B. Dash - Plus sign.
C. Two floats - for width and height
D. Strongly.
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
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.
A. Never!
B. To zero; so pointers are nil.
C. Action
D. Self