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 is ARC done?
The compiler adds code to count references.
Can handle any language because it uses Unicode.
'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.
Strongly.
2. Instead of 'include' statements - in Objective-C we use _______ which does ________
Import / handle multiple inclusion.
UIViewController.
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.
self.view
3. Dot notation does what?
Controls how the model is presented onscreen.
Strong. Object memory is freed at the end of the routine.
Wrap it in NSValue. And remember that NSValue immutable.
On left side - is calling the setter - and on the right side - is calling the getter.
4. A property is just the combination of _______.
NSNumber. For example numberWithDouble: and doubleValue:
Getter and setter methods.
A framework.
@synthesize; write our own getter and/or setter.
5. 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
6. How are local variables initialized in iOS 5?
To zero; so pointers are nil.
line up the colons!
Nothing happens - and nil is returned.
On left side - is calling the setter - and on the right side - is calling the getter.
7. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
8. What is in the model?
One; zero to many
UIViewController.
[[UIView alloc] initWithFrame]
The document; possibly a database.
9. 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
10. What is the iOS term for a library?
line up the colons!
A framework.
Override drawRect:
NSSet; no - it's immutable
11. How can I save user information between launches of my app?
Wrap it in NSValue. And remember that NSValue immutable.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Designated initializer.
NSUserDefaults - which stores a property list.
12. Instance methods start with a ______ and class methods start with a ______.
Getter and setter methods.
Dash - Plus sign.
[[UIView alloc] initWithFrame]
Import / handle multiple inclusion.
13. What does a view (UIView) represent?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
A rectangular area
Two CGFloats for x and y
Dash - Plus sign.
14. There is no difference between _____ and _______ at runtime.
id; an object pointer
NSArray; no - it's immutable.
self
Strong. Object memory is freed at the end of the routine.
15. List the iOS hierarchy from top to bottom.
Lazy instantiation.
Cocoa Touch - Media - Core Services - Core OS
UIWindow
id; an object pointer
16. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
17. Can the controller talking to the view?
self.view
Never!
Yes. As much as it wants.
the controller's minions. Gets things to the screen.
18. When happens when you send a message to nil?
The compiler adds code to count references.
Yes. The controller knows everything about the model.
At runtime.
Nothing happens - and nil is returned.
19. Classes cannot have _________ or ___________.
Properties; instance variables
MVC - for model-view-controller
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.
Dash - Plus sign.
20. How to create a UIView in code?
Lazy instantiation.
[[UIView alloc] initWithFrame]
Wrap it in NSValue. And remember that NSValue immutable.
Argument validation.
21. How to tell if an object is of a particular class? (Write a line of code)
A CGPoint and and a CGSize
'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.
self
[Object isMemberOfClass:[Classname class]]
22. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
Nothing happens - and nil is returned.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
NSLog; %@; %d and other formatters
Strongly.
23. What is used in lieu of pixels? And why?
Action
Getter and setter methods.
NSSet; no - it's immutable
Points - to achieve device-independence
24. ______ is a pointer to any object.
id
Introspection - with the class method 'class'
Class XX = [Object class]
MVC - for model-view-controller
25. The single-view template in Xcode does not...
create a model
NSData
Introspection - with the class method 'class'
NSNumber. For example numberWithDouble: and doubleValue:
26. What is at the top of the view hierarchy?
Yes. As much as it wants.
addSubview; removeFromSubview
UIWindow
Wrap it in NSValue. And remember that NSValue immutable.
27. All properties are initialized to _____
The runtime system asks the object what its class is.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
zero/nil
One; zero to many
28. 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
29. How to force a redraw of a custom area?
Points - to achieve device-independence
The document; possibly a database.
Call setNeedsDisplay:
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
30. A _______ is how a view notifies the controller of something - for example - a button press.
Wrap it in NSValue. And remember that NSValue immutable.
Interface; Implementation
Action
[Object isMemberOfClass:[Classname class]]
31. What do I use for a bag of bits?
Action
Properties; instance variables
NSData
Interface; Implementation
32. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
33. The decision on what method to call is made when?
Import / handle multiple inclusion.
NSSet; no - it's immutable
At runtime.
On left side - is calling the setter - and on the right side - is calling the getter.
34. What about controller talking to the 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.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Yes. The controller knows everything about the model.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
35. 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]]
At runtime.
[Object isMemberOfClass:[Classname class]]
the controller's minions. Gets things to the screen.
36. How to tell whether an object implements a particular method? (A line of code)
[Class respondsToSelector:@selector(aMethod)]
create a model
zero/nil
Instance method; class method.
37. Class methods are used for ___________ and the call starts with ____________.
Never!
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Call setNeedsDisplay:
[Object isKindOfClass:[Classname class]]
38. What is the makeup of a CGRect?
A CGPoint and and a CGSize
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.
NO is zero; YES is anything else.
id; an object pointer
39. Is NSArray mutable?
The compiler adds code to count references.
Can handle any language because it uses Unicode.
Two floats - for width and height
No. Use NSMutableArray - which is a subclass of NSArray.
40. What is the name of a property in the controller that it uses to talk to views?
The runtime system asks the object what its class is.
The document; possibly a database.
An outlet.
[Object isKindOfClass:[Classname class]]
41. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
NSObject
One; zero to many
Outlet; Action
line up the colons!
42. Are local pointers to objects strong or weak? So what happens at the end of the routine?
(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.
id; an object pointer
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Strong. Object memory is freed at the end of the routine.
43. How to instantiate an object?
addSubview; removeFromSubview
The compiler adds code to count references.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Yes. As much as it wants.
44. Objects in an array: are the pointed to strongly or weakly?
Override drawRect:
My rectangle in my superview's coordinate space
Strongly.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
45. Talk about NSString
Strong. Object memory is freed at the end of the routine.
Call setNeedsDisplay:
Getter and setter methods.
Can handle any language because it uses Unicode.
46. Talk about BOOL variables.
line up the colons!
Getter and setter methods.
NO is zero; YES is anything else.
[[UIView alloc] initWithFrame]
47. What is the fundamental design pattern of iOS development?
MVC - for model-view-controller
Nothing happens - and nil is returned.
[Class respondsToSelector:@selector(aMethod)]
[Object isMemberOfClass:[Classname class]]
48. How many superviews does a view have? How many subviews?
option-click; option-double-click
Instance method; class method.
One; zero to many
Other MVC trios.
49. How can I find out the class of any object? Give a line of code.
self
Class XX = [Object class]
No - it gets the data from the controller.
Designated initializer.
50. 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