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. Does a view 'own' the data it displays?
NO is zero; YES is anything else.
No - it gets the data from the controller.
'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.'
Getter and setter methods.
2. The single-view template in Xcode does not...
create a model
[Class respondsToSelector:@selector(aMethod)]
The document; possibly a database.
At runtime.
3. Why are properties good?
NSObject
internal origin and size. Use this inside a view
Yes. As much as it wants.
(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.
4. ______ is a pointer to any object.
id
No. It's fine.
Strongly.
Nothing happens - and nil is returned.
5. What is the fundamental design pattern of iOS development?
Can handle any language because it uses Unicode.
MVC - for model-view-controller
Import / handle multiple inclusion.
[Object isKindOfClass:[Classname class]]
6. What is the word for checking/verifying the type of an object?
7. Is NSArray mutable?
(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.
create a model
No. Use NSMutableArray - which is a subclass of NSArray.
Strongly.
8. What is in the model?
The document; possibly a database.
zero/nil
Never!
NSObject
9. How to force a redraw of a custom area?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Designated initializer.
Call setNeedsDisplay:
A framework.
10. What is static typing? Why is it good?
11. How about the model talking to the controller?
12. What do I use for a bag of bits?
Points - to achieve device-independence
A CGPoint and and a CGSize
Yes. As much as it wants.
NSData
13. There is no difference between _____ and _______ at runtime.
Never!
Getter and setter methods.
id; an object pointer
Interface; Implementation
14. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
15. How to instantiate an object?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Nothing happens - and nil is returned.
Dash - Plus sign.
16. Remember that it's cool to...
NSUserDefaults - which stores a property list.
line up the colons!
Points - to achieve device-independence
Getter and setter methods.
17. What to do in Xcode for short documentation? For full documentation?
Call setNeedsDisplay:
Points - to achieve device-independence
option-click; option-double-click
'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.
18. When is it OK to call drawRect: directly?
Controls how the model is presented onscreen.
Getter and setter methods.
[Object isMemberOfClass:[Classname class]]
Never!
19. How can I save user information between launches of my app?
NSUserDefaults - which stores a property list.
Wrap it in NSValue. And remember that NSValue immutable.
Import / handle multiple inclusion.
the controller's minions. Gets things to the screen.
20. What is the iOS term for a library?
Import / handle multiple inclusion.
Introspection - with the class method 'class'
[Object isKindOfClass:[Classname class]]
A framework.
21. A property is just the combination of _______.
Getter and setter methods.
NSNumber. For example numberWithDouble: and doubleValue:
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Dash - Plus sign.
22. What if I want to put a scalar into an NSArray or NSSet?
Wrap it in NSValue. And remember that NSValue immutable.
No - it gets the data from the controller.
In the getter! This is called lazy instantiation.
An outlet.
23. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
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.
[Object isKindOfClass:[Classname class]]
NSLog; %@; %d and other formatters
Properties; instance variables
24. All classes should have a __________________ to be called by subclasses.
In the getter! This is called lazy instantiation.
Designated initializer.
id; an object pointer
iOS; when the view is loaded.
25. What does a view (UIView) represent?
'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.'
Instance method; class method.
In the getter! This is called lazy instantiation.
A rectangular area
26. In a nutshell: how to do custom drawing?
Override drawRect:
Two floats - for width and height
Interface; Implementation
The compiler adds code to count references.
27. How to create a UIView in code?
Yes. The controller knows everything about the model.
[[UIView alloc] initWithFrame]
Action
self
28. What is the bounds property of a UIView?
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Argument validation.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
internal origin and size. Use this inside a view
29. ________ is the .h file and __________ is the .m file.
Call setNeedsDisplay:
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Interface; Implementation
UIViewController.
30. What is a property list?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
self
NSUserDefaults - which stores a property list.
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.
31. Can the controller talking to the view?
MVC - for model-view-controller
NSDictionary; no - it's immutable.
Yes. As much as it wants.
No - it gets the data from the controller.
32. How many superviews does a view have? How many subviews?
[Object isKindOfClass:[Classname class]]
One; zero to many
line up the colons!
Strong. Object memory is freed at the end of the routine.
33. Show a private interface section.
self.view
One; zero to many
Yes. The controller knows everything about the model.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
34. The decision on what method to call is made when?
At runtime.
(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.
No...but it has 'a way' to notify the controller to come ask for fresh data.
Other MVC trios.
35. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
36. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Outlet; Action
No. Use NSMutableArray - which is a subclass of NSArray.
Action
37. The controller is always a subclass of...?
Outlet; Action
UIViewController.
Dash - Plus sign.
Introspection - with the class method 'class'
38. Calling a method on id works just fine because....?
[Object isKindOfClass:[Classname class]]
Yes. As much as it wants.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
The runtime system asks the object what its class is.
39. What about the model and the view talking to one another?
id; an object pointer
Never!
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
NSArray; no - it's immutable.
40. How to access the controller's top view?
Action
self.view
line up the colons!
Designated initializer.
41. What do I use for a hash table/associative array? And is it mutable?
42. Objects in an array: are the pointed to strongly or weakly?
No - it gets the data from the controller.
Override drawRect:
My rectangle in my superview's coordinate space
Strongly.
43. What is the name of a property in the controller that it uses to talk to views?
[Class respondsToSelector:@selector(aMethod)]
Center of the frame - which is in the superview's coordinate system
An outlet.
Other MVC trios.
44. How to do enumeration with NSArray - NSDictionary - etc?
45. Some controllers have ____________ as their views.
One; zero to many
Other MVC trios.
Cocoa Touch - Media - Core Services - Core OS
'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. How to add subviews in code? How to remove them?
Dash - Plus sign.
addSubview; removeFromSubview
constant NSString
Right-click on view - or even a subview like a button.
47. What is a reason to write our own setter?
NSUserDefaults - which stores a property list.
At runtime.
Argument validation.
id; an object pointer
48. What does 'weak' mean?
49. How to see all actions - outlets - incoming/outgoing segues on a view?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Center of the frame - which is in the superview's coordinate system
addSubview; removeFromSubview
Right-click on view - or even a subview like a button.
50. How to tell if an object is of a particular class? (Write a line of code)
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
[Object isMemberOfClass:[Classname class]]
Properties; instance variables
zero/nil