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. How to tell if an object is of a particular class? (Write a line of code)
[Object isMemberOfClass:[Classname class]]
NSUserDefaults - which stores a property list.
line up the colons!
Never!
2. You can send a message to a...
constant NSString
Two floats - for width and height
In the getter! This is called lazy instantiation.
(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.
3. What about the model and the view talking to one another?
Strong. Object memory is freed at the end of the routine.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Never!
MVC - for model-view-controller
4. What is a reason to write our own setter?
[[UIView alloc] initWithFrame]
Argument validation.
Instance variable (ivar) or 'backing variable'
addSubview; removeFromSubview
5. Remember that it's cool to...
Two CGFloats for x and y
Action
line up the colons!
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
6. What if I want to put a scalar into an NSArray or NSSet?
self
MVC - for model-view-controller
[Class respondsToSelector:@selector(aMethod)]
Wrap it in NSValue. And remember that NSValue immutable.
7. Talk about BOOL variables.
Two floats - for width and height
NO is zero; YES is anything else.
NSSet; no - it's immutable
id
8. How many superviews does a view have? How many subviews?
One; zero to many
self.view
A rectangular area
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.
9. How to create a UIView in code?
for...in; don't change things inside the loop.
[[UIView alloc] initWithFrame]
Call setNeedsDisplay:
iOS; when the view is loaded.
10. Classes cannot have _________ or ___________.
Dash - Plus sign.
(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.
NSSet; no - it's immutable
Properties; instance variables
11. 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
12. The controller is always a subclass of...?
Can handle any language because it uses Unicode.
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.
UIViewController.
NSData
13. Instead of 'include' statements - in Objective-C we use _______ which does ________
id; an object pointer
Import / handle multiple inclusion.
Strongly.
A rectangular area
14. What is the iOS term for a library?
id
A framework.
Action
line up the colons!
15. How to add subviews in code? How to remove them?
An outlet.
addSubview; removeFromSubview
At runtime.
NSUserDefaults - which stores a property list.
16. What is the name of a property in the controller that it uses to talk to views?
Strong. Object memory is freed at the end of the routine.
UIViewController.
An outlet.
NSArray; no - it's immutable.
17. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
MVC - for model-view-controller
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.
Import / handle multiple inclusion.
[Object isKindOfClass:[Classname class]]
18. What does the controller do?
An outlet.
Controls how the model is presented onscreen.
Properties; instance variables
iOS; when the view is loaded.
19. The basic steps in custom drawing.
NSSet; no - it's immutable
id; an object pointer
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.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
20. 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
21. Can the controller talking to the view?
Yes. As much as it wants.
[Object isMemberOfClass:[Classname class]]
line up the colons!
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
22. When happens when you send a message to nil?
NSArray; no - it's immutable.
'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.'
Points - to achieve device-independence
Nothing happens - and nil is returned.
23. 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
24. How to see all actions - outlets - incoming/outgoing segues on a view?
Argument validation.
self.view
Right-click on view - or even a subview like a button.
id
25. Show a private interface section.
UIWindow
Other MVC trios.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
id; an object pointer
26. A _______ is how a view notifies the controller of something - for example - a button press.
zero/nil
Instance method; class method.
Action
Other MVC trios.
27. The setters for outlets are called by _______ at this point ______________.
addSubview; removeFromSubview
iOS; when the view is loaded.
self.view
for...in; don't change things inside the loop.
28. What is the makeup of a CGPoint?
Yes. As much as it wants.
A CGPoint and and a CGSize
NSArray; no - it's immutable.
Two CGFloats for x and y
29. How is ARC done?
NSData
The compiler adds code to count references.
Getter and setter methods.
Dash - Plus sign.
30. ______ is a pointer
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Properties; instance variables
self
Call setNeedsDisplay:
31. What to do in Xcode for short documentation? For full documentation?
option-click; option-double-click
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
An outlet.
zero/nil
32. All properties are initialized to _____
the controller's minions. Gets things to the screen.
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.
iOS; when the view is loaded.
zero/nil
33. Where do I initialize properties?
Two CGFloats for x and y
In the getter! This is called lazy instantiation.
Yes. The controller knows everything about the model.
No. It's fine.
34. What is an example of a reason to write a getter?
Controls how the model is presented onscreen.
UIViewController.
Lazy instantiation.
addSubview; removeFromSubview
35. Is it always bad to send messages to id?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
36. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
37. In a nutshell: how to do custom drawing?
Right-click on view - or even a subview like a button.
Nothing happens - and nil is returned.
Override drawRect:
create a model
38. What is the bounds property of a UIView?
internal origin and size. Use this inside a view
Never!
Other MVC trios.
Center of the frame - which is in the superview's coordinate system
39. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Outlet; Action
A framework.
[Class respondsToSelector:@selector(aMethod)]
NO is zero; YES is anything else.
40. What do I use for a bag of bits?
UIViewController.
NSData
Instance method; class method.
the controller's minions. Gets things to the screen.
41. How to force a redraw of a custom area?
the controller's minions. Gets things to the screen.
iOS; when the view is loaded.
for...in; don't change things inside the loop.
Call setNeedsDisplay:
42. There is no difference between _____ and _______ at runtime.
NSLog; %@; %d and other formatters
Lazy instantiation.
Never!
id; an object pointer
43. 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
44. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
45. 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.
Points - to achieve device-independence
The compiler adds code to count references.
for...in; don't change things inside the loop.
46. What is the makeup of a CGRect?
Import / handle multiple inclusion.
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 CGPoint and and a CGSize
Cocoa Touch - Media - Core Services - Core OS
47. 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
48. If I need to convert a number to an object - use __________
Getter and setter methods.
NSNumber. For example numberWithDouble: and doubleValue:
MVC - for model-view-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.
49. The single-view template in Xcode does not...
self.view
Nothing happens - and nil is returned.
Right-click on view - or even a subview like a button.
create a model
50. What is at the top of the view hierarchy?
Wrap it in NSValue. And remember that NSValue immutable.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
UIWindow
Controls how the model is presented onscreen.