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 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
2. ______ is a pointer to any object.
Introspection - with the class method 'class'
id
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.
Nothing happens - and nil is returned.
3. Class methods are used for ___________ and the call starts with ____________.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
(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.
Yes. The controller knows everything about the model.
At runtime.
4. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Dash - Plus sign.
self
In the getter! This is called lazy instantiation.
Outlet; Action
5. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
6. What is at the top of the view hierarchy?
UIWindow
Nothing happens - and nil is returned.
The compiler adds code to count references.
NSLog; %@; %d and other formatters
7. How can I save user information between launches of my app?
(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.
create a model
NSUserDefaults - which stores a property list.
NSDictionary; no - it's immutable.
8. How to access the controller's top view?
self.view
[Object isKindOfClass:[Classname class]]
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
self
9. All properties are initialized to _____
for...in; don't change things inside the loop.
MVC - for model-view-controller
zero/nil
Points - to achieve device-independence
10. The single-view template in Xcode does not...
No. Use NSMutableArray - which is a subclass of NSArray.
create a model
Properties; instance variables
[Object isMemberOfClass:[Classname class]]
11. 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
12. What is the makeup of a CGSize?
Designated initializer.
At runtime.
Two floats - for width and height
To zero; so pointers are nil.
13. How to create a UIView in code?
[[UIView alloc] initWithFrame]
Lazy instantiation.
self
Outlet; Action
14. Dot notation does what?
Action
On left side - is calling the setter - and on the right side - is calling the getter.
NSNumber. For example numberWithDouble: and doubleValue:
The document; possibly a database.
15. How can I find out the class of any object? Give a line of code.
Class XX = [Object class]
iOS; when the view is loaded.
A rectangular area
A CGPoint and and a CGSize
16. Talk about BOOL variables.
NO is zero; YES is anything else.
zero/nil
No. It's fine.
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.
17. When happens when you send a message to nil?
At runtime.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Nothing happens - and nil is returned.
To zero; so pointers are nil.
18. Can the controller talking to the view?
MVC - for model-view-controller
Yes. As much as it wants.
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.
Designated initializer.
19. What about controller talking to the model?
NSSet; no - it's immutable
Import / handle multiple inclusion.
Dash - Plus sign.
Yes. The controller knows everything about the model.
20. ________ is the .h file and __________ is the .m file.
Strong. Object memory is freed at the end of the routine.
Interface; Implementation
NSDictionary; no - it's immutable.
Controls how the model is presented onscreen.
21. What is in the model?
internal origin and size. Use this inside a view
The document; possibly a database.
line up the colons!
Argument validation.
22. How many superviews does a view have? How many subviews?
The compiler adds code to count references.
At runtime.
No. Use NSMutableArray - which is a subclass of NSArray.
One; zero to many
23. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
24. What is the makeup of a CGPoint?
Never!
Two CGFloats for x and y
Properties; instance variables
addSubview; removeFromSubview
25. What to do in Xcode for short documentation? For full documentation?
Center of the frame - which is in the superview's coordinate system
Wrap it in NSValue. And remember that NSValue immutable.
option-click; option-double-click
My rectangle in my superview's coordinate space
26. 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
27. A property is just the combination of _______.
[Object isMemberOfClass:[Classname class]]
On left side - is calling the setter - and on the right side - is calling the getter.
Getter and setter methods.
[Class respondsToSelector:@selector(aMethod)]
28. What do I use for a bag of bits?
Two CGFloats for x and y
iOS; when the view is loaded.
[Class respondsToSelector:@selector(aMethod)]
NSData
29. What is the name of a property in the controller that it uses to talk to views?
An outlet.
One; zero to many
NSDictionary; no - it's immutable.
Strong. Object memory is freed at the end of the routine.
30. How to force a redraw of a custom area?
Center of the frame - which is in the superview's coordinate system
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.
Call setNeedsDisplay:
id; an object pointer
31. There is no difference between _____ and _______ at runtime.
id; an object pointer
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.
create a model
NSData
32. How to see all actions - outlets - incoming/outgoing segues on a view?
NSNumber. For example numberWithDouble: and doubleValue:
Strong. Object memory is freed at the end of the routine.
[Object isMemberOfClass:[Classname class]]
Right-click on view - or even a subview like a button.
33. In the initializer methods of objects I create - add what line of code? Why?
Can handle any language because it uses Unicode.
No...but it has 'a way' to notify the controller to come ask for fresh data.
NSLog; %@; %d and other formatters
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.
34. Are local pointers to objects strong or weak? So what happens at the end of the routine?
UIViewController.
Class XX = [Object class]
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
35. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
internal origin and size. Use this inside a view
Can handle any language because it uses Unicode.
NSLog; %@; %d and other formatters
[Object isKindOfClass:[Classname class]]
36. Instead of 'include' statements - in Objective-C we use _______ which does ________
Argument validation.
The compiler adds code to count references.
Import / handle multiple inclusion.
Override drawRect:
37. Instance methods start with a ______ and class methods start with a ______.
Dash - Plus sign.
The compiler adds code to count references.
On left side - is calling the setter - and on the right side - is calling the getter.
Controls how the model is presented onscreen.
38. What is the iOS term for a library?
A framework.
The runtime system asks the object what its class is.
In the getter! This is called lazy instantiation.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
39. Does a view 'own' the data it displays?
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
No - it gets the data from the controller.
Call setNeedsDisplay:
Center of the frame - which is in the superview's coordinate system
40. What is the bounds property of a UIView?
Controls how the model is presented onscreen.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
The compiler adds code to count references.
internal origin and size. Use this inside a view
41. 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];
The compiler adds code to count references.
Interface; Implementation
No...but it has 'a way' to notify the controller to come ask for fresh data.
42. 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
43. 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
44. ______ 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.
self
[Object isKindOfClass:[Classname class]]
Argument validation.
45. How is ARC done?
Call setNeedsDisplay:
Can handle any language because it uses Unicode.
The compiler adds code to count references.
'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.'
46. What is used in lieu of pixels? And why?
Points - to achieve device-independence
NSUserDefaults - which stores a property list.
NSDictionary; no - it's immutable.
MVC - for model-view-controller
47. A _______ is how a view notifies the controller of something - for example - a button press.
'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.'
Action
Center of the frame - which is in the superview's coordinate system
Argument validation.
48. 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
49. What is a property list?
Instance variable (ivar) or 'backing variable'
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
At runtime.
50. If I need to convert a number to an object - use __________
NSArray; no - it's immutable.
NSNumber. For example numberWithDouble: and doubleValue:
Two CGFloats for x and y
Instance method; class method.