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. ________ is the .h file and __________ is the .m file.
Interface; Implementation
Designated initializer.
NSDictionary; no - it's immutable.
Call setNeedsDisplay:
2. How about the model talking to the controller?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
3. What is the makeup of a CGPoint?
Yes. The controller knows everything about the model.
Two CGFloats for x and y
Strongly.
'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.
4. Why are properties good?
A CGPoint and and a CGSize
On left side - is calling the setter - and on the right side - is calling the getter.
(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.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
5. What do I use for a bag of bits?
internal origin and size. Use this inside a view
No. Use NSMutableArray - which is a subclass of NSArray.
Class XX = [Object class]
NSData
6. What is a property list?
NSUserDefaults - which stores a property list.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
id
iOS; when the view is loaded.
7. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
8. 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
9. 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
10. What about the model and the view talking to one another?
Never!
(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.
On left side - is calling the setter - and on the right side - is calling the getter.
Action
11. How are local variables initialized in iOS 5?
To zero; so pointers are nil.
option-click; option-double-click
id; an object pointer
Strong. Object memory is freed at the end of the routine.
12. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
[Object isKindOfClass:[Classname class]]
self
@synthesize; write our own getter and/or setter.
13. How to see all actions - outlets - incoming/outgoing segues on a view?
Yes. The controller knows everything about the model.
Right-click on view - or even a subview like a button.
[Class respondsToSelector:@selector(aMethod)]
NSNumber. For example numberWithDouble: and doubleValue:
14. How to create a UIView in code?
The compiler adds code to count references.
[[UIView alloc] initWithFrame]
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
No...but it has 'a way' to notify the controller to come ask for fresh data.
15. What is the name of a property in the controller that it uses to talk to views?
NSNumber. For example numberWithDouble: and doubleValue:
An outlet.
NSObject
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.
16. 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
17. A _______ is how a view notifies the controller of something - for example - a button press.
NSData
The runtime system asks the object what its class is.
Action
@synthesize; write our own getter and/or setter.
18. Can the controller talking to the view?
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.
'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.'
UIWindow
Yes. As much as it wants.
19. In a nutshell: how to do custom drawing?
self
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Override drawRect:
20. 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
21. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
22. When happens when you send a message to nil?
Yes. As much as it wants.
No. It's fine.
NO is zero; YES is anything else.
Nothing happens - and nil is returned.
23. ______ is a pointer to any object.
The document; possibly a database.
Never!
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.
id
24. How can I save user information between launches of my app?
No...but it has 'a way' to notify the controller to come ask for fresh data.
NSUserDefaults - which stores a property list.
One; zero to many
My rectangle in my superview's coordinate space
25. What is the makeup of a CGSize?
Argument validation.
Two floats - for width and height
NSObject
NSLog; %@; %d and other formatters
26. What is the base class for most objects in the iOS SDK?
One; zero to many
NSSet; no - it's immutable
NSObject
Properties; instance variables
27. When is it OK to call drawRect: directly?
On left side - is calling the setter - and on the right side - is calling the getter.
Never!
NSLog; %@; %d and other formatters
Dash - Plus sign.
28. Talk about NSString
Can handle any language because it uses Unicode.
Instance method; class method.
Override drawRect:
@synthesize; write our own getter and/or setter.
29. What does a view (UIView) represent?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
A framework.
UIWindow
A rectangular area
30. Some controllers have ____________ as their views.
Class XX = [Object class]
line up the colons!
Other MVC trios.
No. Use NSMutableArray - which is a subclass of NSArray.
31. Does a view 'own' the data it displays?
Wrap it in NSValue. And remember that NSValue immutable.
A CGPoint and and a CGSize
Never!
No - it gets the data from the controller.
32. A property is just the combination of _______.
At runtime.
Cocoa Touch - Media - Core Services - Core OS
Getter and setter methods.
Dash - Plus sign.
33. 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.
Getter and setter methods.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
34. All properties are initialized to _____
for...in; don't change things inside the loop.
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.
No. It's fine.
zero/nil
35. Remember that it's cool to...
One; zero to many
Import / handle multiple inclusion.
line up the colons!
Outlet; Action
36. What about public/private in Objective-C?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
37. 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
38. If I need to convert a number to an object - use __________
option-click; option-double-click
NSNumber. For example numberWithDouble: and doubleValue:
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Override drawRect:
39. What is static typing? Why is it good?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
40. What if I want to put a scalar into an NSArray or NSSet?
Wrap it in NSValue. And remember that NSValue immutable.
Two CGFloats for x and y
[Object isKindOfClass:[Classname class]]
A CGPoint and and a CGSize
41. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
NSSet; no - it's immutable
NSNumber. For example numberWithDouble: and doubleValue:
Instance method; class method.
On left side - is calling the setter - and on the right side - is calling the getter.
42. In the initializer methods of objects I create - add what line of code? Why?
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.
Yes. As much as it wants.
No...but it has 'a way' to notify the controller to come ask for fresh data.
iOS; when the view is loaded.
43. What is in the model?
Import / handle multiple inclusion.
Can handle any language because it uses Unicode.
Override drawRect:
The document; possibly a database.
44. List the iOS hierarchy from top to bottom.
In the getter! This is called lazy instantiation.
Cocoa Touch - Media - Core Services - Core OS
To zero; so pointers are nil.
addSubview; removeFromSubview
45. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
Call setNeedsDisplay:
[Object isKindOfClass:[Classname class]]
No...but it has 'a way' to notify the controller to come ask for fresh data.
NSLog; %@; %d and other formatters
46. What is the fundamental design pattern of iOS development?
MVC - for model-view-controller
@synthesize; write our own getter and/or setter.
Center of the frame - which is in the superview's coordinate system
Getter and setter methods.
47. What is used in lieu of pixels? And why?
On left side - is calling the setter - and on the right side - is calling the getter.
Points - to achieve device-independence
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Import / handle multiple inclusion.
48. The single-view template in Xcode does not...
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.
Designated initializer.
create a model
Class XX = [Object class]
49. All classes should have a __________________ to be called by subclasses.
NO is zero; YES is anything else.
Designated initializer.
Outlet; Action
The compiler adds code to count references.
50. How can I find out the class of any object? Give a line of code.
The document; possibly a database.
Interface; Implementation
Class XX = [Object class]
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.