SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
|
Email
Search
Test your basic knowledge |
iOS 5 App Development 2
Start Test
Study First
Subjects
:
it-skills
,
apple
Instructions:
Answer 50 questions in 15 minutes.
If you are not ready to take this test, you can
study here
.
Match each statement with the correct term.
Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.
This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. List the iOS hierarchy from top to bottom.
Can handle any language because it uses Unicode.
Cocoa Touch - Media - Core Services - Core OS
Interface; Implementation
Strong. Object memory is freed at the end of the routine.
2. All properties are initialized to _____
The document; possibly a database.
'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.
Outlet; Action
zero/nil
3. There is no difference between _____ and _______ at runtime.
Yes. As much as it wants.
id; an object pointer
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
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.
4. What is the bounds property of a UIView?
Can handle any language because it uses Unicode.
Action
create a model
internal origin and size. Use this inside a view
5. ________ is the .h file and __________ is the .m file.
the controller's minions. Gets things to the screen.
Instance method; class method.
Outlet; Action
Interface; Implementation
6. The setters for outlets are called by _______ at this point ______________.
Strong. Object memory is freed at the end of the routine.
iOS; when the view is loaded.
Two CGFloats for x and y
constant NSString
7. What is a property list?
[Class respondsToSelector:@selector(aMethod)]
self
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Class XX = [Object class]
8. Dot notation does what?
In the getter! This is called lazy instantiation.
NSSet; no - it's immutable
Never!
On left side - is calling the setter - and on the right side - is calling the getter.
9. What about the view talking to the controller?
10. How to do enumeration with NSArray - NSDictionary - etc?
11. In the initializer methods of objects I create - add what line of code? Why?
self.view
Center of the frame - which is in the superview's coordinate system
The compiler adds code to count references.
self = [super init] {if init is the designated initializer of the superclass}. If the superclass init routine fails - I will know to return nil from my init routine.
12. ______ is a pointer to any object.
line up the colons!
Never!
NSDictionary; no - it's immutable.
id
13. How to access the controller's top view?
NSLog; %@; %d and other formatters
self.view
Can handle any language because it uses Unicode.
Strongly.
14. Why are properties good?
addSubview; removeFromSubview
An outlet.
Action
(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.
15. What is the word for checking/verifying the type of an object?
16. Does a view 'own' the data it displays?
Action
Lazy instantiation.
No - it gets the data from the controller.
UIViewController.
17. Class methods are used for ___________ and the call starts with ____________.
NSArray; no - it's immutable.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
To zero; so pointers are nil.
Properties; instance variables
18. What does 'strong' mean?
19. What is the frame property of a UIView?
20. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
21. How are local variables initialized in iOS 5?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Nothing happens - and nil is returned.
To zero; so pointers are nil.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
22. A _______ is how a view notifies the controller of something - for example - a button press.
Designated initializer.
Never!
Action
Interface; Implementation
23. What is a reason to write our own setter?
Argument validation.
Class XX = [Object class]
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
The document; possibly a database.
24. When is it OK to call drawRect: directly?
One; zero to many
Never!
the controller's minions. Gets things to the screen.
Interface; Implementation
25. Talk about BOOL variables.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
NO is zero; YES is anything else.
Center of the frame - which is in the superview's coordinate system
'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.
26. Objects in an array: are the pointed to strongly or weakly?
Strongly.
Interface; Implementation
Outlet; Action
NO is zero; YES is anything else.
27. What do I use for a hash table/associative array? And is it mutable?
28. What about public/private in Objective-C?
29. What is in the model?
Instance variable (ivar) or 'backing variable'
self.view
The document; possibly a database.
(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.
30. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
A rectangular area
NSData
Never!
Outlet; Action
31. How many superviews does a view have? How many subviews?
One; zero to many
A CGPoint and and a CGSize
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
[[UIView alloc] initWithFrame]
32. When happens when you send a message to nil?
Nothing happens - and nil is returned.
Controls how the model is presented onscreen.
Getter and setter methods.
Two floats - for width and height
33. What is the makeup of a CGPoint?
'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.'
No. Use NSMutableArray - which is a subclass of NSArray.
NSArray; no - it's immutable.
Two CGFloats for x and y
34. Is NSArray mutable?
No. Use NSMutableArray - which is a subclass of NSArray.
Import / handle multiple inclusion.
Dash - Plus sign.
Nothing happens - and nil is returned.
35. Show a private interface section.
Yes. As much as it wants.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
No. Use NSMutableArray - which is a subclass of NSArray.
To zero; so pointers are nil.
36. How is ARC done?
self = [super init] {if init is the designated initializer of the superclass}. If the superclass init routine fails - I will know to return nil from my init routine.
Lazy instantiation.
The compiler adds code to count references.
NSDictionary; no - it's immutable.
37. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
In the getter! This is called lazy instantiation.
Instance variable (ivar) or 'backing variable'
The runtime system asks the object what its class is.
[Object isKindOfClass:[Classname class]]
38. What to do in Xcode for short documentation? For full documentation?
NSData
option-click; option-double-click
Properties; instance variables
zero/nil
39. How to add subviews in code? How to remove them?
addSubview; removeFromSubview
[Object isKindOfClass:[Classname class]]
Call setNeedsDisplay:
The document; possibly a database.
40. What about the model and the view talking to one another?
Argument validation.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Never!
id
41. What does 'weak' mean?
42. What is the fundamental design pattern of iOS development?
The runtime system asks the object what its class is.
Action
constant NSString
MVC - for model-view-controller
43. What if I want to put a scalar into an NSArray or NSSet?
In the getter! This is called lazy instantiation.
[Object isKindOfClass:[Classname class]]
Action
Wrap it in NSValue. And remember that NSValue immutable.
44. Is NSString mutable or not?
self
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
NSDictionary; no - it's immutable.
Getter and setter methods.
45. The controller is always a subclass of...?
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Points - to achieve device-independence
UIViewController.
'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.
46. What is the base class for most objects in the iOS SDK?
UIWindow
NSObject
Nothing happens - and nil is returned.
Never!
47. How to force a redraw of a custom area?
Points - to achieve device-independence
Call setNeedsDisplay:
Center of the frame - which is in the superview's coordinate system
At runtime.
48. ________ implements the getter and setter. But we can always__________
Getter and setter methods.
self
@synthesize; write our own getter and/or setter.
internal origin and size. Use this inside a view
49. The single-view template in Xcode does not...
create a model
Getter and setter methods.
On left side - is calling the setter - and on the right side - is calling the getter.
Import / handle multiple inclusion.
50. Where do I initialize properties?
In the getter! This is called lazy instantiation.
NSArray; no - it's immutable.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
[Object isMemberOfClass:[Classname class]]