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. What does a view (UIView) represent?
One; zero to many
A rectangular area
Getter and setter methods.
Other MVC trios.
2. What is the base class for most objects in the iOS SDK?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
NSObject
Center of the frame - which is in the superview's coordinate system
Other MVC trios.
3. 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
4. ______ is a pointer to any object.
Wrap it in NSValue. And remember that NSValue immutable.
create a model
id
Outlet; Action
5. The setters for outlets are called by _______ at this point ______________.
Outlet; Action
NSNumber. For example numberWithDouble: and doubleValue:
Lazy instantiation.
iOS; when the view is loaded.
6. How to tell whether an object implements a particular method? (A line of code)
[Class respondsToSelector:@selector(aMethod)]
Getter and setter methods.
NSLog; %@; %d and other formatters
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.
7. Classes cannot have _________ or ___________.
Controls how the model is presented onscreen.
NSNumber. For example numberWithDouble: and doubleValue:
Cocoa Touch - Media - Core Services - Core OS
Properties; instance variables
8. How many superviews does a view have? How many subviews?
A CGPoint and and a CGSize
Never!
Properties; instance variables
One; zero to many
9. ________ implements the getter and setter. But we can always__________
iOS; when the view is loaded.
@synthesize; write our own getter and/or setter.
Wrap it in NSValue. And remember that NSValue immutable.
One; zero to many
10. When happens when you send a message to nil?
Nothing happens - and nil is returned.
NSData
Override drawRect:
No...but it has 'a way' to notify the controller to come ask for fresh data.
11. What about controller talking to the model?
Yes. The controller knows everything about the model.
An outlet.
Controls how the model is presented onscreen.
One; zero to many
12. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
Dash - Plus sign.
[Object isKindOfClass:[Classname class]]
One; zero to many
@synthesize; write our own getter and/or setter.
13. What is the makeup of a CGPoint?
option-click; option-double-click
Controls how the model is presented onscreen.
Two CGFloats for x and y
UIWindow
14. What is the iOS term for a library?
NO is zero; YES is anything else.
A framework.
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.
No - it gets the data from the controller.
15. 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
16. In the initializer methods of objects I create - add what line of code? Why?
option-click; option-double-click
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.
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.
Yes. As much as it wants.
17. Is NSString mutable or not?
Action
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
NSUserDefaults - which stores a property list.
Never!
18. What do I use for a bag of bits?
Nothing happens - and nil is returned.
NSData
for...in; don't change things inside the loop.
My rectangle in my superview's coordinate space
19. The controller is always a subclass of...?
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
UIViewController.
Action
(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.
20. 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
21. In a nutshell: how to do custom drawing?
Override drawRect:
One; zero to many
NSLog; %@; %d and other formatters
Cocoa Touch - Media - Core Services - Core OS
22. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Outlet; Action
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.
constant NSString
Action
23. Show a private interface section.
NSSet; no - it's immutable
option-click; option-double-click
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Never!
24. What to do in Xcode for short documentation? For full documentation?
option-click; option-double-click
@synthesize; write our own getter and/or setter.
line up the colons!
NSNumber. For example numberWithDouble: and doubleValue:
25. What is used in lieu of pixels? And why?
Points - to achieve device-independence
The runtime system asks the object what its class is.
The document; possibly a database.
In the getter! This is called lazy instantiation.
26. What about the model and the view talking to one another?
Never!
line up the colons!
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
MVC - for model-view-controller
27. 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
28. What is a property list?
MVC - for model-view-controller
Can handle any language because it uses Unicode.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Override drawRect:
29. The single-view template in Xcode does not...
Nothing happens - and nil is returned.
create a model
Designated initializer.
UIViewController.
30. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
NSDictionary; no - it's immutable.
NSLog; %@; %d and other formatters
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
NO is zero; YES is anything else.
31. What if I want to put a scalar into an NSArray or NSSet?
To zero; so pointers are nil.
Interface; Implementation
Wrap it in NSValue. And remember that NSValue immutable.
NSSet; no - it's immutable
32. Instance methods start with a ______ and class methods start with a ______.
self
Dash - Plus sign.
On left side - is calling the setter - and on the right side - is calling the getter.
Introspection - with the class method 'class'
33. ______ is a pointer
Properties; instance variables
Nothing happens - and nil is returned.
self
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.
34. Can the controller talking to the view?
NSNumber. For example numberWithDouble: and doubleValue:
@synthesize; write our own getter and/or setter.
addSubview; removeFromSubview
Yes. As much as it wants.
35. What is at the top of the view hierarchy?
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
NSObject
UIWindow
No...but it has 'a way' to notify the controller to come ask for fresh data.
36. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
37. 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
38. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
39. You can send a message to a...
Override drawRect:
addSubview; removeFromSubview
constant NSString
NSArray; no - it's immutable.
40. What is a reason to write our own setter?
One; zero to many
Argument validation.
id; an object pointer
Dash - Plus sign.
41. There is no difference between _____ and _______ at runtime.
id; an object pointer
for...in; don't change things inside the loop.
Cocoa Touch - Media - Core Services - Core OS
NO is zero; YES is anything else.
42. What is the name of a property in the controller that it uses to talk to views?
An outlet.
The runtime system asks the object what its class is.
A framework.
No...but it has 'a way' to notify the controller to come ask for fresh data.
43. Dot notation does what?
On left side - is calling the setter - and on the right side - is calling the getter.
Can handle any language because it uses Unicode.
Instance variable (ivar) or 'backing variable'
Interface; Implementation
44. When is it OK to call drawRect: directly?
Call setNeedsDisplay:
Never!
UIWindow
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.
45. How to access the controller's top view?
Import / handle multiple inclusion.
addSubview; removeFromSubview
self.view
Controls how the model is presented onscreen.
46. If I need to convert a number to an object - use __________
No - it gets the data from the controller.
NSUserDefaults - which stores a property list.
Two CGFloats for x and y
NSNumber. For example numberWithDouble: and doubleValue:
47. Is NSArray mutable?
Other MVC trios.
No. Use NSMutableArray - which is a subclass of NSArray.
zero/nil
Argument validation.
48. How to tell if an object is of a particular class? (Write a line of code)
No - it gets the data from the controller.
[Object isMemberOfClass:[Classname class]]
id
addSubview; removeFromSubview
49. Objects in an array: are the pointed to strongly or weakly?
Strongly.
'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.
NSDictionary; no - it's immutable.
internal origin and size. Use this inside a view
50. What is the fundamental design pattern of iOS development?
MVC - for model-view-controller
NSData
zero/nil
An outlet.