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