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. Talk about NSString
A rectangular area
Strongly.
Can handle any language because it uses Unicode.
NSLog; %@; %d and other formatters
2. How to see all actions - outlets - incoming/outgoing segues on a view?
NSData
Outlet; Action
(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.
Right-click on view - or even a subview like a button.
3. ________ implements the getter and setter. But we can always__________
My rectangle in my superview's coordinate space
Dash - Plus sign.
Properties; instance variables
@synthesize; write our own getter and/or setter.
4. What about the model and the view talking to one another?
Import / handle multiple inclusion.
NSUserDefaults - which stores a property list.
Never!
Other MVC trios.
5. How to instantiate an object?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
A rectangular area
Getter and setter methods.
Nothing happens - and nil is returned.
6. How can I save user information between launches of my app?
NSUserDefaults - which stores a property list.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
On left side - is calling the setter - and on the right side - is calling the getter.
The compiler adds code to count references.
7. What is the name of a property in the controller that it uses to talk to views?
An outlet.
No...but it has 'a way' to notify the controller to come ask for fresh data.
Action
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
8. Are local pointers to objects strong or weak? So what happens at the end of the routine?
Dash - Plus sign.
No. It's fine.
Strong. Object memory is freed at the end of the routine.
Outlet; Action
9. What is at the top of the view hierarchy?
One; zero to many
Import / handle multiple inclusion.
Dash - Plus sign.
UIWindow
10. Can the controller talking to the view?
Argument validation.
NSNumber. For example numberWithDouble: and doubleValue:
NSArray; no - it's immutable.
Yes. As much as it wants.
11. If I need to convert a number to an object - use __________
zero/nil
To zero; so pointers are nil.
NSNumber. For example numberWithDouble: and doubleValue:
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
12. Classes cannot have _________ or ___________.
Lazy instantiation.
Nothing happens - and nil is returned.
Properties; instance variables
[Object isKindOfClass:[Classname class]]
13. How to access the controller's top view?
NSLog; %@; %d and other formatters
The document; possibly a database.
Yes. As much as it wants.
self.view
14. 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
15. Some controllers have ____________ as their views.
Other MVC trios.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
A rectangular area
Nothing happens - and nil is returned.
16. What is the fundamental design pattern of iOS development?
Never!
option-click; option-double-click
Argument validation.
MVC - for model-view-controller
17. ______ is a pointer to any object.
NSObject
[Object isKindOfClass:[Classname class]]
id
A rectangular area
18. ________ is the .h file and __________ is the .m file.
self
Interface; Implementation
option-click; option-double-click
Getter and setter methods.
19. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
Two CGFloats for x and y
NSLog; %@; %d and other formatters
To zero; so pointers are nil.
zero/nil
20. How is ARC done?
The compiler adds code to count references.
for...in; don't change things inside the loop.
NSSet; no - it's immutable
Getter and setter methods.
21. A _______ is how a view notifies the controller of something - for example - a button press.
NSData
[Object isKindOfClass:[Classname class]]
Override drawRect:
Action
22. What is the base class for most objects in the iOS SDK?
My rectangle in my superview's coordinate space
Cocoa Touch - Media - Core Services - Core OS
Yes. The controller knows everything about the model.
NSObject
23. How to add subviews in code? How to remove them?
Getter and setter methods.
addSubview; removeFromSubview
Argument validation.
[Object isMemberOfClass:[Classname class]]
24. 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
25. What is used in lieu of pixels? And why?
Two CGFloats for x and y
In the getter! This is called lazy instantiation.
Points - to achieve device-independence
id
26. What is in the model?
The document; possibly a database.
No. Use NSMutableArray - which is a subclass of NSArray.
Action
self.view
27. 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
28. A property is just the combination of _______.
Getter and setter methods.
NSObject
Never!
Wrap it in NSValue. And remember that NSValue immutable.
29. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
30. 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
31. 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
32. What is an example of a reason to write a getter?
Lazy instantiation.
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.
A CGPoint and and a CGSize
NSSet; no - it's immutable
33. 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
34. What do I use for a bag of bits?
NSNumber. For example numberWithDouble: and doubleValue:
Designated initializer.
NSLog; %@; %d and other formatters
NSData
35. Is NSArray mutable?
Designated initializer.
No. Use NSMutableArray - which is a subclass of NSArray.
addSubview; removeFromSubview
line up the colons!
36. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
[Object isKindOfClass:[Classname class]]
@synthesize; write our own getter and/or setter.
line up the colons!
Call setNeedsDisplay:
37. What is a reason to write our own setter?
iOS; when the view is loaded.
the controller's minions. Gets things to the screen.
Can handle any language because it uses Unicode.
Argument validation.
38. 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
39. Show a private interface section.
[Object isKindOfClass:[Classname class]]
A framework.
At runtime.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
40. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
41. 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
42. How to force a redraw of a custom area?
self
NO is zero; YES is anything else.
Call setNeedsDisplay:
Other MVC trios.
43. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
44. How many superviews does a view have? How many subviews?
One; zero to many
No - it gets the data from the controller.
NSSet; no - it's immutable
Yes. The controller knows everything about the model.
45. The single-view template in Xcode does not...
create a model
Can handle any language because it uses Unicode.
Outlet; Action
UIViewController.
46. What is the bounds property of a UIView?
Strongly.
On left side - is calling the setter - and on the right side - is calling the getter.
internal origin and size. Use this inside a view
create a model
47. What about controller talking to the model?
Yes. The controller knows everything about the model.
Interface; Implementation
NSSet; no - it's immutable
Right-click on view - or even a subview like a button.
48. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Outlet; Action
Other MVC trios.
@synthesize; write our own getter and/or setter.
zero/nil
49. Where do I initialize properties?
My rectangle in my superview's coordinate space
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
In the getter! This is called lazy instantiation.
Getter and setter methods.
50. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
[Object isMemberOfClass:[Classname class]]
Instance method; class method.
'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.'
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];