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. When is it OK to call drawRect: directly?
Never!
NO is zero; YES is anything else.
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.
2. You can send a message to a...
constant NSString
[Class respondsToSelector:@selector(aMethod)]
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
3. 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
4. Dot notation does what?
Center of the frame - which is in the superview's coordinate system
NSNumber. For example numberWithDouble: and doubleValue:
self.view
On left side - is calling the setter - and on the right side - is calling the getter.
5. How many superviews does a view have? How many subviews?
One; zero to many
Never!
UIViewController.
NO is zero; YES is anything else.
6. 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
7. What is in the model?
'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.
Dash - Plus sign.
The document; possibly a database.
A rectangular area
8. 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
9. Classes cannot have _________ or ___________.
To zero; so pointers are nil.
A rectangular area
Call setNeedsDisplay:
Properties; instance variables
10. 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
11. How to force a redraw of a custom area?
constant NSString
NSNumber. For example numberWithDouble: and doubleValue:
Call setNeedsDisplay:
Center of the frame - which is in the superview's coordinate system
12. 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
13. What is the iOS term for a library?
@synthesize; write our own getter and/or setter.
Instance method; class method.
The runtime system asks the object what its class is.
A framework.
14. What is a property list?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
self.view
Call setNeedsDisplay:
addSubview; removeFromSubview
15. How to tell whether an object implements a particular method? (A line of code)
NSSet; no - it's immutable
addSubview; removeFromSubview
Right-click on view - or even a subview like a button.
[Class respondsToSelector:@selector(aMethod)]
16. What is the makeup of a CGSize?
NSData
Controls how the model is presented onscreen.
Two floats - for width and height
Points - to achieve device-independence
17. Is NSString mutable or not?
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Import / handle multiple inclusion.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Lazy instantiation.
18. What is the word for checking/verifying the type of an object?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
19. List the iOS hierarchy from top to bottom.
NSNumber. For example numberWithDouble: and doubleValue:
constant NSString
Cocoa Touch - Media - Core Services - Core OS
The runtime system asks the object what its class is.
20. A property is just the combination of _______.
Getter and setter methods.
To zero; so pointers are nil.
On left side - is calling the setter - and on the right side - is calling the getter.
Interface; Implementation
21. What is the makeup of a CGRect?
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
NSUserDefaults - which stores a property list.
Yes. The controller knows everything about the model.
A CGPoint and and a CGSize
22. What about the model and the view talking to one another?
An outlet.
The document; possibly a database.
Never!
NO is zero; YES is anything else.
23. What is a reason to write our own setter?
Properties; instance variables
Interface; Implementation
Argument validation.
@synthesize; write our own getter and/or setter.
24. Are local pointers to objects strong or weak? So what happens at the end of the routine?
The runtime system asks the object what its class is.
Strong. Object memory is freed at the end of the routine.
To zero; so pointers are nil.
'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.
25. When happens when you send a message to nil?
UIWindow
A framework.
No...but it has 'a way' to notify the controller to come ask for fresh data.
Nothing happens - and nil is returned.
26. Talk about BOOL variables.
Interface; Implementation
Nothing happens - and nil is returned.
NO is zero; YES is anything else.
[Object isKindOfClass:[Classname class]]
27. Remember that it's cool to...
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
line up the colons!
Argument validation.
addSubview; removeFromSubview
28. What to do in Xcode for short documentation? For full documentation?
NSData
option-click; option-double-click
Getter and setter methods.
@synthesize; write our own getter and/or setter.
29. How to create a UIView in code?
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.
One; zero to many
for...in; don't change things inside the loop.
[[UIView alloc] initWithFrame]
30. The decision on what method to call is made when?
UIViewController.
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.
line up the colons!
At runtime.
31. What is the base class for most objects in the iOS SDK?
Properties; instance variables
Strongly.
No...but it has 'a way' to notify the controller to come ask for fresh data.
NSObject
32. How to add subviews in code? How to remove them?
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.
(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.
iOS; when the view is loaded.
addSubview; removeFromSubview
33. The single-view template in Xcode does not...
create a model
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.
Never!
NSUserDefaults - which stores a property list.
34. A _______ is how a view notifies the controller of something - for example - a button press.
NO is zero; YES is anything else.
Action
Can handle any language because it uses Unicode.
Instance method; class method.
35. 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
36. 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
37. The setters for outlets are called by _______ at this point ______________.
Never!
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
iOS; when the view is loaded.
In the getter! This is called lazy instantiation.
38. Can the controller talking to the view?
Yes. As much as it wants.
Call setNeedsDisplay:
the controller's minions. Gets things to the screen.
Strongly.
39. Some controllers have ____________ as their views.
NSLog; %@; %d and other formatters
zero/nil
Properties; instance variables
Other MVC trios.
40. What if I want to put a scalar into an NSArray or NSSet?
At runtime.
Points - to achieve device-independence
Wrap it in NSValue. And remember that NSValue immutable.
self
41. Talk about NSString
NO is zero; YES is anything else.
'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.'
Can handle any language because it uses Unicode.
Import / handle multiple inclusion.
42. In the initializer methods of objects I create - add what line of code? Why?
Override drawRect:
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.
On left side - is calling the setter - and on the right side - is calling the getter.
Nothing happens - and nil is returned.
43. What is the bounds property of a UIView?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Interface; Implementation
No. It's fine.
internal origin and size. Use this inside a view
44. What does a view (UIView) represent?
A framework.
Yes. The controller knows everything about the model.
Import / handle multiple inclusion.
A rectangular area
45. If I need to convert a number to an object - use __________
Call setNeedsDisplay:
[Object isKindOfClass:[Classname class]]
NSNumber. For example numberWithDouble: and doubleValue:
Import / handle multiple inclusion.
46. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
A rectangular area
Instance method; class method.
The runtime system asks the object what its class is.
47. ______ is a pointer
An outlet.
'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.'
Never!
self
48. 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
49. Objects in an array: are the pointed to strongly or weakly?
Yes. As much as it wants.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Strongly.
The runtime system asks the object what its class is.
50. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183