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.
Two floats - for width and height
Interface; Implementation
One; zero to many
2. What is the makeup of a CGSize?
No - it gets the data from the controller.
A framework.
Two floats - for width and height
the controller's minions. Gets things to the screen.
3. 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
4. How can I find out the class of any object? Give a line of code.
'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.'
Class XX = [Object class]
No. It's fine.
Outlet; Action
5. Some controllers have ____________ as their views.
id
Other MVC trios.
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.
self
6. 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
7. How are local variables initialized in iOS 5?
To zero; so pointers are nil.
Interface; Implementation
Lazy instantiation.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
8. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
9. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
Argument validation.
At runtime.
[Object isKindOfClass:[Classname class]]
option-click; option-double-click
10. Dot notation does what?
Action
On left side - is calling the setter - and on the right side - is calling the getter.
NSLog; %@; %d and other formatters
NSObject
11. A _______ is how a view notifies the controller of something - for example - a button press.
[Class respondsToSelector:@selector(aMethod)]
Action
Interface; Implementation
Never!
12. A property is just the combination of _______.
create a model
Outlet; Action
Other MVC trios.
Getter and setter methods.
13. How to instantiate an object?
[Object isMemberOfClass:[Classname class]]
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Other MVC trios.
Argument validation.
14. 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
15. How many superviews does a view have? How many subviews?
iOS; when the view is loaded.
Instance method; class method.
One; zero to many
My rectangle in my superview's coordinate space
16. In a nutshell: how to do custom drawing?
Override drawRect:
A CGPoint and and a CGSize
No. It's fine.
NSDictionary; no - it's immutable.
17. Does a view 'own' the data it displays?
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.
NSLog; %@; %d and other formatters
No - it gets the data from the controller.
NSObject
18. What is at the top of the view hierarchy?
Instance method; class method.
UIWindow
Yes. As much as it wants.
Yes. The controller knows everything about the model.
19. 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.
Designated initializer.
NSUserDefaults - which stores a property list.
iOS; when the view is loaded.
20. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
Cocoa Touch - Media - Core Services - Core OS
Lazy instantiation.
NSLog; %@; %d and other formatters
(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.
21. What is a property list?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Class XX = [Object class]
Introspection - with the class method 'class'
'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.'
22. 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
23. Show a private interface section.
One; zero to many
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
iOS; when the view is loaded.
Controls how the model is presented onscreen.
24. How to create a UIView in code?
Strongly.
for...in; don't change things inside the loop.
[[UIView alloc] initWithFrame]
[Object isKindOfClass:[Classname class]]
25. What does the controller do?
'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.'
Controls how the model is presented onscreen.
Strongly.
My rectangle in my superview's coordinate space
26. What is in the model?
Two CGFloats for x and y
iOS; when the view is loaded.
The document; possibly a database.
Cocoa Touch - Media - Core Services - Core OS
27. Can the controller talking to the view?
Yes. As much as it wants.
(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.
The compiler adds code to count references.
Never!
28. The single-view template in Xcode does not...
Dash - Plus sign.
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.
create a model
NSLog; %@; %d and other formatters
29. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Lazy instantiation.
Instance method; class method.
Import / handle multiple inclusion.
My rectangle in my superview's coordinate space
30. Talk about NSString
Cocoa Touch - Media - Core Services - Core OS
The runtime system asks the object what its class is.
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.
Can handle any language because it uses Unicode.
31. When happens when you send a message to nil?
UIWindow
Getter and setter methods.
Outlet; Action
Nothing happens - and nil is returned.
32. 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
33. What about controller talking to the model?
MVC - for model-view-controller
Yes. The controller knows everything about the model.
[[UIView alloc] initWithFrame]
No. It's fine.
34. What is the iOS term for a library?
A framework.
Override drawRect:
One; zero to many
self
35. What is the name of a property in the controller that it uses to talk to views?
An outlet.
One; zero to many
NSNumber. For example numberWithDouble: and doubleValue:
Dash - Plus sign.
36. All properties are initialized to _____
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
'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.
zero/nil
In the getter! This is called lazy instantiation.
37. The controller is always a subclass of...?
Yes. As much as it wants.
Never!
NSNumber. For example numberWithDouble: and doubleValue:
UIViewController.
38. Instead of 'include' statements - in Objective-C we use _______ which does ________
Import / handle multiple inclusion.
Can handle any language because it uses Unicode.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Controls how the model is presented onscreen.
39. 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
40. ______ is a pointer
A framework.
Two floats - for width and height
self
Right-click on view - or even a subview like a button.
41. What is the makeup of a CGRect?
Can handle any language because it uses Unicode.
Center of the frame - which is in the superview's coordinate system
[Class respondsToSelector:@selector(aMethod)]
A CGPoint and and a CGSize
42. 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
43. Calling a method on id works just fine because....?
The runtime system asks the object what its class is.
MVC - for model-view-controller
Two CGFloats for x and y
[[UIView alloc] initWithFrame]
44. What if I want to put a scalar into an NSArray or NSSet?
for...in; don't change things inside the loop.
Can handle any language because it uses Unicode.
id; an object pointer
Wrap it in NSValue. And remember that NSValue immutable.
45. 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
46. ________ is the .h file and __________ is the .m file.
Points - to achieve device-independence
constant NSString
[Class respondsToSelector:@selector(aMethod)]
Interface; Implementation
47. What is the bounds property of a UIView?
[Object isKindOfClass:[Classname class]]
internal origin and size. Use this inside a view
Dash - Plus sign.
[Class respondsToSelector:@selector(aMethod)]
48. How to force a redraw of a custom area?
NSData
UIWindow
Call setNeedsDisplay:
An outlet.
49. Talk about BOOL variables.
Interface; Implementation
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.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
NO is zero; YES is anything else.
50. Is NSArray mutable?
No. Use NSMutableArray - which is a subclass of NSArray.
Yes. The controller knows everything about the model.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
My rectangle in my superview's coordinate space