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 tell if an object is of a particular class? (Write a line of code)
Lazy instantiation.
[Object isMemberOfClass:[Classname class]]
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Outlet; Action
2. What does a view (UIView) represent?
UIViewController.
NO is zero; YES is anything else.
Outlet; Action
A rectangular area
3. What is the makeup of a CGSize?
Yes. The controller knows everything about the model.
Two floats - for width and height
line up the colons!
Interface; Implementation
4. The single-view template in Xcode does not...
iOS; when the view is loaded.
Properties; instance variables
option-click; option-double-click
create a model
5. All classes should have a __________________ to be called by subclasses.
Wrap it in NSValue. And remember that NSValue immutable.
A CGPoint and and a CGSize
Designated initializer.
Two floats - for width and height
6. 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
7. What is the name of a property in the controller that it uses to talk to views?
Never!
constant NSString
[[UIView alloc] initWithFrame]
An outlet.
8. Is NSString mutable or not?
A CGPoint and and a CGSize
Override drawRect:
(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.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
9. Show a private interface section.
NSDictionary; no - it's immutable.
[Object isMemberOfClass:[Classname class]]
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
constant NSString
10. What is a reason to write our own setter?
Argument validation.
MVC - for model-view-controller
Two floats - for width and height
Controls how the model is presented onscreen.
11. 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
12. 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 runtime system asks the object what its class is.
No...but it has 'a way' to notify the controller to come ask for fresh data.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
13. Remember that it's cool to...
Never!
In the getter! This is called lazy instantiation.
Introspection - with the class method 'class'
line up the colons!
14. A property is just the combination of _______.
Nothing happens - and nil is returned.
Getter and setter methods.
The compiler adds code to count references.
Yes. The controller knows everything about the model.
15. Talk about BOOL variables.
NO is zero; YES is anything else.
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.
NSSet; no - it's immutable
16. 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
17. ________ is the .h file and __________ is the .m file.
Interface; Implementation
@synthesize; write our own getter and/or setter.
iOS; when the view is loaded.
Two floats - for width and height
18. There is no difference between _____ and _______ at runtime.
id; an object pointer
Wrap it in NSValue. And remember that NSValue immutable.
id
An outlet.
19. What is in the model?
zero/nil
NSLog; %@; %d and other formatters
The document; possibly a database.
Controls how the model is presented onscreen.
20. How to see all actions - outlets - incoming/outgoing segues on a view?
self
Other MVC trios.
Right-click on view - or even a subview like a button.
Getter and setter methods.
21. What does the controller do?
An outlet.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Controls how the model is presented onscreen.
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.
22. What is the bounds property of a UIView?
A CGPoint and and a CGSize
internal origin and size. Use this inside a view
Center of the frame - which is in the superview's coordinate system
Yes. The controller knows everything about the model.
23. What is a property list?
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Override drawRect:
[Object isKindOfClass:[Classname class]]
24. The decision on what method to call is made when?
At runtime.
To zero; so pointers are nil.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Two CGFloats for x and y
25. What is the fundamental design pattern of iOS development?
MVC - for model-view-controller
To zero; so pointers are nil.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Controls how the model is presented onscreen.
26. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
27. Instead of 'include' statements - in Objective-C we use _______ which does ________
the controller's minions. Gets things to the screen.
constant NSString
NO is zero; YES is anything else.
Import / handle multiple inclusion.
28. What is an example of a reason to write a getter?
No. Use NSMutableArray - which is a subclass of NSArray.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
An outlet.
Lazy instantiation.
29. In a nutshell: how to do custom drawing?
NSSet; no - it's immutable
NO is zero; YES is anything else.
Override drawRect:
Strongly.
30. How to force a redraw of a custom area?
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Call setNeedsDisplay:
internal origin and size. Use this inside a view
[Object isKindOfClass:[Classname class]]
31. How many superviews does a view have? How many subviews?
No. It's fine.
One; zero to many
Nothing happens - and nil is returned.
Controls how the model is presented onscreen.
32. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
33. What is the makeup of a CGRect?
Two CGFloats for x and y
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.
zero/nil
A CGPoint and and a CGSize
34. ______ is a pointer to any object.
NSLog; %@; %d and other formatters
NSSet; no - it's immutable
The runtime system asks the object what its class is.
id
35. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
the controller's minions. Gets things to the screen.
NSSet; no - it's immutable
Instance method; class method.
36. Instance methods start with a ______ and class methods start with a ______.
Dash - Plus sign.
NSSet; no - it's immutable
Strongly.
@synthesize; write our own getter and/or setter.
37. How to access the controller's top view?
(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.
self.view
Outlet; Action
NSDictionary; no - it's immutable.
38. Are local pointers to objects strong or weak? So what happens at the end of the routine?
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.
The runtime system asks the object what its class is.
Strong. Object memory is freed at the end of the routine.
Lazy instantiation.
39. What do I use for a bag of bits?
self.view
Wrap it in NSValue. And remember that NSValue immutable.
NSData
One; zero to many
40. 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
41. How to tell whether an object implements a particular method? (A line of code)
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.
Call setNeedsDisplay:
Wrap it in NSValue. And remember that NSValue immutable.
[Class respondsToSelector:@selector(aMethod)]
42. The setters for outlets are called by _______ at this point ______________.
iOS; when the view is loaded.
Import / handle multiple inclusion.
NSUserDefaults - which stores a property list.
Cocoa Touch - Media - Core Services - Core OS
43. 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
44. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
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
[Object isKindOfClass:[Classname class]]
the controller's minions. Gets things to the screen.
45. 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
46. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Getter and setter methods.
The runtime system asks the object what its class is.
Outlet; Action
47. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
48. 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
49. How to add subviews in code? How to remove them?
self
Right-click on view - or even a subview like a button.
addSubview; removeFromSubview
Can handle any language because it uses Unicode.
50. What if I want to put a scalar into an NSArray or NSSet?
Import / handle multiple inclusion.
Wrap it in NSValue. And remember that NSValue immutable.
Getter and setter methods.
The runtime system asks the object what its class is.