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)
Instance variable (ivar) or 'backing variable'
Instance method; class method.
[Object isMemberOfClass:[Classname 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.'
2. In a nutshell: how to do custom drawing?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
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.
Override drawRect:
Strong. Object memory is freed at the end of the routine.
3. What do I use for a bag of bits?
One; zero to many
NSData
A rectangular area
NSNumber. For example numberWithDouble: and doubleValue:
4. When is it OK to call drawRect: directly?
[Class respondsToSelector:@selector(aMethod)]
addSubview; removeFromSubview
UIWindow
Never!
5. 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
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. 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
8. ________ is the .h file and __________ is the .m file.
for...in; don't change things inside the loop.
Interface; Implementation
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
On left side - is calling the setter - and on the right side - is calling the getter.
9. How to see all actions - outlets - incoming/outgoing segues on a view?
Two CGFloats for x and y
self
Right-click on view - or even a subview like a button.
Can handle any language because it uses Unicode.
10. In the initializer methods of objects I create - add what line of code? Why?
'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.'
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.
Instance variable (ivar) or 'backing variable'
'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.
11. Show a private interface section.
Wrap it in NSValue. And remember that NSValue immutable.
An outlet.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Points - to achieve device-independence
12. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
NSSet; no - it's immutable
Points - to achieve device-independence
Instance method; class method.
NO is zero; YES is anything else.
13. How to force a redraw of a custom area?
Call setNeedsDisplay:
Center of the frame - which is in the superview's coordinate system
Other MVC trios.
Class XX = [Object class]
14. 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
15. What to do in Xcode for short documentation? For full documentation?
option-click; option-double-click
NSArray; no - it's immutable.
Never!
The runtime system asks the object what its class is.
16. Instance methods start with a ______ and class methods start with a ______.
Dash - Plus sign.
addSubview; removeFromSubview
Instance variable (ivar) or 'backing variable'
At runtime.
17. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
the controller's minions. Gets things to the screen.
Wrap it in NSValue. And remember that NSValue immutable.
Can handle any language because it uses Unicode.
Outlet; Action
18. Is NSString mutable or not?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
NSSet; no - it's immutable
self
Right-click on view - or even a subview like a button.
19. What is the makeup of a CGPoint?
Two CGFloats for x and y
Instance method; class method.
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.
iOS; when the view is loaded.
20. The decision on what method to call is made when?
Cocoa Touch - Media - Core Services - Core OS
At runtime.
NSUserDefaults - which stores a property list.
Argument validation.
21. What is used in lieu of pixels? And why?
NSObject
Points - to achieve device-independence
Yes. The controller knows everything about the model.
Right-click on view - or even a subview like a button.
22. How are local variables initialized in iOS 5?
The document; possibly a database.
To zero; so pointers are nil.
Two floats - for width and height
My rectangle in my superview's coordinate space
23. ________ implements the getter and setter. But we can always__________
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.
The compiler adds code to count references.
Instance method; class method.
24. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
25. All classes should have a __________________ to be called by subclasses.
Never!
Designated initializer.
No...but it has 'a way' to notify the controller to come ask for fresh data.
Two CGFloats for x and y
26. What is the makeup of a CGSize?
Override drawRect:
NSArray; no - it's immutable.
My rectangle in my superview's coordinate space
Two floats - for width and height
27. Remember that it's cool to...
line up the colons!
NO is zero; YES is anything else.
Can handle any language because it uses Unicode.
An outlet.
28. 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
29. ______ is a pointer to any object.
Strong. Object memory is freed at the end of the routine.
Nothing happens - and nil is returned.
id
Never!
30. A property is just the combination of _______.
Can handle any language because it uses Unicode.
Getter and setter methods.
Instance variable (ivar) or 'backing variable'
Controls how the model is presented onscreen.
31. Talk about NSString
NSUserDefaults - which stores a property list.
id; an object pointer
Points - to achieve device-independence
Can handle any language because it uses Unicode.
32. What is a property list?
Properties; instance variables
MVC - for model-view-controller
Introspection - with the class method 'class'
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
33. The single-view template in Xcode does not...
[Object isMemberOfClass:[Classname class]]
create a model
Action
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
34. Can the controller talking to the view?
Can handle any language because it uses Unicode.
No. Use NSMutableArray - which is a subclass of NSArray.
self
Yes. As much as it wants.
35. 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
36. 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
37. Instead of 'include' statements - in Objective-C we use _______ which does ________
Import / handle multiple inclusion.
The compiler adds code to count references.
Two CGFloats for x and y
Designated initializer.
38. 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
39. Does a view 'own' the data it displays?
Introspection - with the class method 'class'
A CGPoint and and a CGSize
No - it gets the data from the controller.
Properties; instance variables
40. Some controllers have ____________ as their views.
UIWindow
Other MVC trios.
MVC - for model-view-controller
Nothing happens - and nil is returned.
41. How to tell whether an object implements a particular method? (A line of code)
Class XX = [Object class]
[Object isMemberOfClass:[Classname class]]
[Class respondsToSelector:@selector(aMethod)]
line up the colons!
42. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
43. What is an example of a reason to write a getter?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
One; zero to many
Lazy instantiation.
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.
44. There is no difference between _____ and _______ at runtime.
Outlet; Action
NSDictionary; no - it's immutable.
id; an object pointer
NSUserDefaults - which stores a property list.
45. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
46. Objects in an array: are the pointed to strongly or weakly?
A framework.
Strongly.
NSObject
[Object isKindOfClass:[Classname class]]
47. The controller is always a subclass of...?
UIViewController.
Introspection - with the class method 'class'
the controller's minions. Gets things to the screen.
Nothing happens - and nil is returned.
48. What about the model and the view talking to one another?
The compiler adds code to count references.
Outlet; Action
Never!
Class XX = [Object class]
49. What is the base class for most objects in the iOS SDK?
My rectangle in my superview's coordinate space
NSObject
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
No. It's fine.
50. All properties are initialized to _____
zero/nil
No - it gets the data from the controller.
Cocoa Touch - Media - Core Services - Core OS
internal origin and size. Use this inside a view