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. What is the name of a property in the controller that it uses to talk to views?
An outlet.
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.
Cocoa Touch - Media - Core Services - Core OS
A rectangular area
2. How to access the controller's top view?
self.view
A rectangular area
addSubview; removeFromSubview
'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.
3. You can send a message to a...
Two floats - for width and height
Never!
constant NSString
Call setNeedsDisplay:
4. How are local variables initialized in iOS 5?
Can handle any language because it uses Unicode.
To zero; so pointers are nil.
Properties; instance variables
option-click; option-double-click
5. Does a view 'own' the data it displays?
Cocoa Touch - Media - Core Services - Core OS
No - it gets the data from the controller.
'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
6. What do I use for an ordered collection of objects? And is it mutable?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
7. What about the view talking to the controller?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
8. ________ implements the getter and setter. But we can always__________
MVC - for model-view-controller
Lazy instantiation.
@synthesize; write our own getter and/or setter.
Interface; Implementation
9. How to create a UIView in code?
Two CGFloats for x and y
One; zero to many
An outlet.
[[UIView alloc] initWithFrame]
10. How to force a redraw of a custom area?
for...in; don't change things inside the loop.
Properties; instance variables
Points - to achieve device-independence
Call setNeedsDisplay:
11. Dot notation does what?
NSSet; no - it's immutable
On left side - is calling the setter - and on the right side - is calling the getter.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Designated initializer.
12. All properties are initialized to _____
zero/nil
Instance method; class method.
[Class respondsToSelector:@selector(aMethod)]
Designated initializer.
13. What to do in Xcode for short documentation? For full documentation?
'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.
(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.
Interface; Implementation
option-click; option-double-click
14. If I need to convert a number to an object - use __________
NSNumber. For example numberWithDouble: and doubleValue:
Import / handle multiple inclusion.
Action
[Object isKindOfClass:[Classname class]]
15. What do I use for a hash table/associative array? And is it mutable?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
16. What is the frame property of a UIView?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
17. When is it OK to call drawRect: directly?
NSLog; %@; %d and other formatters
Nothing happens - and nil is returned.
Never!
NSObject
18. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
19. The decision on what method to call is made when?
iOS; when the view is loaded.
self
Points - to achieve device-independence
At runtime.
20. What is the base class for most objects in the iOS SDK?
id
NSObject
No. Use NSMutableArray - which is a subclass of NSArray.
[[UIView alloc] initWithFrame]
21. What is the fundamental design pattern of iOS development?
MVC - for model-view-controller
No...but it has 'a way' to notify the controller to come ask for fresh data.
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.
Nothing happens - and nil is returned.
22. What is the iOS term for a library?
A CGPoint and and a CGSize
A framework.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
The runtime system asks the object what its class is.
23. What is the center property of a UIView?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
24. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
25. Remember that it's cool to...
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
line up the colons!
Strong. Object memory is freed at the end of the routine.
for...in; don't change things inside the loop.
26. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Controls how the model is presented onscreen.
Instance method; class method.
Nothing happens - and nil is returned.
Introspection - with the class method 'class'
27. The setters for outlets are called by _______ at this point ______________.
[Class respondsToSelector:@selector(aMethod)]
Override drawRect:
iOS; when the view is loaded.
NSData
28. How to tell whether an object implements a particular method? (A line of code)
'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.
[Class respondsToSelector:@selector(aMethod)]
Right-click on view - or even a subview like a button.
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.
29. Class methods are used for ___________ and the call starts with ____________.
NO is zero; YES is anything else.
Dash - Plus sign.
Getter and setter methods.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
30. Instead of 'include' statements - in Objective-C we use _______ which does ________
Import / handle multiple inclusion.
self.view
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
31. How can I save user information between launches of my app?
NSUserDefaults - which stores a property list.
[Object isMemberOfClass:[Classname class]]
iOS; when the view is loaded.
The compiler adds code to count references.
32. What does a view (UIView) represent?
A rectangular area
id; an object pointer
'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.
Override drawRect:
33. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
34. How to do enumeration with NSArray - NSDictionary - etc?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
35. Instance methods start with a ______ and class methods start with a ______.
Dash - Plus sign.
A framework.
'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.
Yes. The controller knows everything about the model.
36. Why are properties good?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
(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.
The compiler adds code to count references.
internal origin and size. Use this inside a view
37. What do I use for a bag of bits?
the controller's minions. Gets things to the screen.
NSData
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Right-click on view - or even a subview like a button.
38. What is the makeup of a CGRect?
Lazy instantiation.
Call setNeedsDisplay:
Outlet; Action
A CGPoint and and a CGSize
39. How to see all actions - outlets - incoming/outgoing segues on a view?
[[UIView alloc] initWithFrame]
Strong. Object memory is freed at the end of the routine.
Points - to achieve device-independence
Right-click on view - or even a subview like a button.
40. What about the model and the view talking to one another?
@synthesize; write our own getter and/or setter.
Never!
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.
UIViewController.
41. Calling a method on id works just fine because....?
Getter and setter methods.
An outlet.
My rectangle in my superview's coordinate space
The runtime system asks the object what its class is.
42. ______ is a pointer to any object.
@synthesize; write our own getter and/or setter.
Yes. As much as it wants.
id
Properties; instance variables
43. What about controller talking to the model?
Yes. The controller knows everything about the model.
A CGPoint and and a CGSize
Outlet; Action
@synthesize; write our own getter and/or setter.
44. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
45. Is NSString mutable or not?
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Argument validation.
46. A _______ is how a view notifies the controller of something - for example - a button press.
option-click; option-double-click
Wrap it in NSValue. And remember that NSValue immutable.
Never!
Action
47. ______ is a pointer
No - it gets the data from the controller.
On left side - is calling the setter - and on the right side - is calling the getter.
self
Argument validation.
48. All classes should have a __________________ to be called by subclasses.
Introspection - with the class method 'class'
Designated initializer.
Center of the frame - which is in the superview's coordinate system
The document; possibly a database.
49. What does the controller do?
Controls how the model is presented onscreen.
NSLog; %@; %d and other formatters
Strongly.
Yes. As much as it wants.
50. What is the makeup of a CGPoint?
No - it gets the data from the controller.
UIViewController.
The document; possibly a database.
Two CGFloats for x and y