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. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
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.
Properties; instance variables
Class XX = [Object class]
2. The basic steps in custom drawing.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
internal origin and size. Use this inside a view
create a model
The compiler adds code to count references.
3. All properties are initialized to _____
On left side - is calling the setter - and on the right side - is calling the getter.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
My rectangle in my superview's coordinate space
zero/nil
4. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
5. How to do enumeration with NSArray - NSDictionary - etc?
6. What is the bounds property of a UIView?
for...in; don't change things inside the loop.
internal origin and size. Use this inside a view
Yes. The controller knows everything about the model.
NSLog; %@; %d and other formatters
7. What do I use for a bag of bits?
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.
NSData
Right-click on view - or even a subview like a button.
On left side - is calling the setter - and on the right side - is calling the getter.
8. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Outlet; Action
[[UIView alloc] initWithFrame]
NSDictionary; no - it's immutable.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
9. What does 'strong' mean?
10. Show a private interface section.
(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.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Can handle any language because it uses Unicode.
Import / handle multiple inclusion.
11. Calling a method on id works just fine because....?
The runtime system asks the object what its class is.
[[UIView alloc] initWithFrame]
At runtime.
'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.
12. When happens when you send a message to nil?
Instance method; class method.
Nothing happens - and nil is returned.
id
constant NSString
13. The decision on what method to call is made when?
Outlet; Action
At runtime.
Properties; instance variables
constant NSString
14. What is the word for checking/verifying the type of an object?
15. What is the fundamental design pattern of iOS development?
The compiler adds code to count references.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Import / handle multiple inclusion.
MVC - for model-view-controller
16. What is at the top of the view hierarchy?
NSUserDefaults - which stores a property list.
[Object isMemberOfClass:[Classname class]]
UIWindow
Right-click on view - or even a subview like a button.
17. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
Other MVC trios.
id; an object pointer
[Object isKindOfClass:[Classname class]]
Nothing happens - and nil is returned.
18. Classes cannot have _________ or ___________.
iOS; when the view is loaded.
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.
the controller's minions. Gets things to the screen.
Properties; instance variables
19. What is in the model?
Never!
NSNumber. For example numberWithDouble: and doubleValue:
No. It's fine.
The document; possibly a database.
20. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
The compiler adds code to count references.
NSArray; no - it's immutable.
Instance method; class method.
21. Is it always bad to send messages to id?
22. What about the view talking to the controller?
23. What about public/private in Objective-C?
24. How to instantiate an object?
'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.
UIWindow
create a model
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
25. 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.
No. It's fine.
Call setNeedsDisplay:
internal origin and size. Use this inside a view
26. What is the makeup of a CGSize?
Two floats - for width and height
Yes. The controller knows everything about the model.
[Object isKindOfClass:[Classname class]]
No. It's fine.
27. In a nutshell: how to do custom drawing?
Override drawRect:
Points - to achieve device-independence
Nothing happens - and nil is returned.
A framework.
28. How to access the controller's top view?
Two CGFloats for x and y
self.view
option-click; option-double-click
Call setNeedsDisplay:
29. What is the name of a property in the controller that it uses to talk to views?
[Object isKindOfClass:[Classname class]]
UIWindow
An outlet.
Introspection - with the class method 'class'
30. What is a reason to write our own setter?
Argument validation.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Two CGFloats for x and y
id
31. What to do in Xcode for short documentation? For full documentation?
A CGPoint and and a CGSize
(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.
option-click; option-double-click
Points - to achieve device-independence
32. The single-view template in Xcode does not...
create a model
NSLog; %@; %d and other formatters
One; zero to many
My rectangle in my superview's coordinate space
33. You can send a message to a...
constant NSString
'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.
An outlet.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
34. How many superviews does a view have? How many subviews?
One; zero to many
'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.
(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.
'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.'
35. Are local pointers to objects strong or weak? So what happens at the end of the routine?
A rectangular area
Strong. Object memory is freed at the end of the routine.
No...but it has 'a way' to notify the controller to come ask for fresh data.
zero/nil
36. ______ is a pointer to any object.
Wrap it in NSValue. And remember that NSValue immutable.
id
Other MVC trios.
Instance variable (ivar) or 'backing variable'
37. Some controllers have ____________ as their views.
Other MVC trios.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
One; zero to many
id; an object pointer
38. A property is just the combination of _______.
An outlet.
Getter and setter methods.
Cocoa Touch - Media - Core Services - Core OS
Argument validation.
39. What is the center property of a UIView?
40. List the iOS hierarchy from top to bottom.
Cocoa Touch - Media - Core Services - Core OS
Two CGFloats for x and y
Override drawRect:
NSLog; %@; %d and other formatters
41. What is static typing? Why is it good?
42. What about the model and the view talking to one another?
Two CGFloats for x and y
Strong. Object memory is freed at the end of the routine.
Center of the frame - which is in the superview's coordinate system
Never!
43. The setters for outlets are called by _______ at this point ______________.
The compiler adds code to count references.
iOS; when the view is loaded.
At runtime.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
44. Where do I initialize properties?
On left side - is calling the setter - and on the right side - is calling the getter.
NO is zero; YES is anything else.
In the getter! This is called lazy instantiation.
Right-click on view - or even a subview like a button.
45. What do I use for a hash table/associative array? And is it mutable?
46. What is the iOS term for a library?
[Object isKindOfClass:[Classname class]]
A framework.
Argument validation.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
47. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
48. In the initializer methods of objects I create - add what line of code? Why?
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Introspection - with the class method 'class'
option-click; option-double-click
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.
49. When is it OK to call drawRect: directly?
Never!
NSDictionary; no - it's immutable.
One; zero to many
[Object isKindOfClass:[Classname class]]
50. The controller is always a subclass of...?
MVC - for model-view-controller
UIViewController.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Dash - Plus sign.