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. ________ implements the getter and setter. But we can always__________
NO is zero; YES is anything else.
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.
@synthesize; write our own getter and/or setter.
2. 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
3. How can I find out the class of any object? Give a line of code.
Class XX = [Object class]
for...in; don't change things inside the loop.
On left side - is calling the setter - and on the right side - is calling the getter.
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.
4. Show a private interface section.
constant NSString
Right-click on view - or even a subview like a button.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Strong. Object memory is freed at the end of the routine.
5. What is the makeup of a CGRect?
constant NSString
NSObject
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
A CGPoint and and a CGSize
6. 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
7. Calling a method on id works just fine because....?
The runtime system asks the object what its class is.
NSLog; %@; %d and other formatters
Interface; Implementation
internal origin and size. Use this inside a view
8. Dot notation does what?
On left side - is calling the setter - and on the right side - is calling the getter.
Other MVC trios.
The document; possibly a database.
Call setNeedsDisplay:
9. The decision on what method to call is made when?
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
NSUserDefaults - which stores a property list.
At runtime.
A CGPoint and and a CGSize
10. Does a view 'own' the data it displays?
No - it gets the data from the controller.
Points - to achieve device-independence
NSArray; no - it's immutable.
the controller's minions. Gets things to the screen.
11. How to tell if an object is of a particular class? (Write a line of code)
[Object isMemberOfClass:[Classname class]]
Call setNeedsDisplay:
Override drawRect:
Argument validation.
12. All classes should have a __________________ to be called by subclasses.
Designated initializer.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
On left side - is calling the setter - and on the right side - is calling the getter.
NSObject
13. What does a view (UIView) represent?
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
NSData
for...in; don't change things inside the loop.
A rectangular area
14. What is a property list?
A CGPoint and and a CGSize
An outlet.
Argument validation.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
15. The single-view template in Xcode does not...
Never!
create a model
Strongly.
NO is zero; YES is anything else.
16. How can I save user information between launches of my app?
Import / handle multiple inclusion.
NSUserDefaults - which stores a property list.
Override drawRect:
Points - to achieve device-independence
17. ________ is the .h file and __________ is the .m file.
Instance method; class method.
Interface; Implementation
id
zero/nil
18. What is the makeup of a CGSize?
Center of the frame - which is in the superview's coordinate system
Two floats - for width and height
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
self.view
19. 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
20. Where do I initialize properties?
In the getter! This is called lazy instantiation.
Yes. As much as it wants.
NSSet; no - it's immutable
option-click; option-double-click
21. Classes cannot have _________ or ___________.
No - it gets the data from the controller.
No...but it has 'a way' to notify the controller to come ask for fresh data.
Instance method; class method.
Properties; instance variables
22. In a nutshell: how to do custom drawing?
Override drawRect:
[Object isKindOfClass:[Classname class]]
The runtime system asks the object what its class is.
NO is zero; YES is anything else.
23. 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
24. What is the base class for most objects in the iOS SDK?
self.view
Lazy instantiation.
create a model
NSObject
25. Some controllers have ____________ as their views.
Dash - Plus sign.
Nothing happens - and nil is returned.
Getter and setter methods.
Other MVC trios.
26. Are local pointers to objects strong or weak? So what happens at the end of the routine?
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.
Strong. Object memory is freed at the end of the routine.
Yes. The controller knows everything about the model.
A rectangular area
27. What is the makeup of a CGPoint?
The runtime system asks the object what its class is.
(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.
Never!
Two CGFloats for x and y
28. What about the model and the view talking to one another?
Never!
UIWindow
To zero; so pointers are nil.
'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.
29. All properties are initialized to _____
At runtime.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
zero/nil
Yes. The controller knows everything about the model.
30. Instead of 'include' statements - in Objective-C we use _______ which does ________
Other MVC trios.
id; an object pointer
self.view
Import / handle multiple inclusion.
31. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Outlet; Action
[Object isKindOfClass:[Classname class]]
addSubview; removeFromSubview
32. What does the controller do?
Controls how the model is presented onscreen.
(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.
Wrap it in NSValue. And remember that NSValue immutable.
Yes. The controller knows everything about the model.
33. Remember that it's cool to...
line up the colons!
[Class respondsToSelector:@selector(aMethod)]
Other MVC trios.
create a model
34. What is in the model?
Call setNeedsDisplay:
constant NSString
The document; possibly a database.
MVC - for model-view-controller
35. 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
36. How to add subviews in code? How to remove them?
NO is zero; YES is anything else.
Can handle any language because it uses Unicode.
A framework.
addSubview; removeFromSubview
37. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
38. How to tell whether an object implements a particular method? (A line of code)
A framework.
Lazy instantiation.
[Class respondsToSelector:@selector(aMethod)]
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.
39. There is no difference between _____ and _______ at runtime.
Two floats - for width and height
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.
One; zero to many
40. The setters for outlets are called by _______ at this point ______________.
option-click; option-double-click
iOS; when the view is loaded.
Import / handle multiple inclusion.
'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.'
41. 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
42. The controller is always a subclass of...?
self.view
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.
UIViewController.
43. 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
44. 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
45. The basic steps in custom drawing.
Other MVC trios.
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.
At runtime.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
46. How is ARC done?
No. It's fine.
The compiler adds code to count references.
In the getter! This is called lazy instantiation.
No - it gets the data from the controller.
47. When happens when you send a message to nil?
Nothing happens - and nil is returned.
Right-click on view - or even a subview like a button.
The compiler adds code to count references.
self.view
48. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
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.
Override drawRect:
Outlet; Action
self
49. What is used in lieu of pixels? And why?
Points - to achieve device-independence
Properties; instance variables
MVC - for model-view-controller
Strongly.
50. What is the iOS term for a library?
Lazy instantiation.
create a model
A framework.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.