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 is the center property of a UIView?
2. Dot notation does what?
Properties; instance variables
On left side - is calling the setter - and on the right side - is calling the getter.
At runtime.
No...but it has 'a way' to notify the controller to come ask for fresh data.
3. What about public/private in Objective-C?
4. How about the model talking to the controller?
5. Are local pointers to objects strong or weak? So what happens at the end of the routine?
NSDictionary; no - it's immutable.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
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.
Strong. Object memory is freed at the end of the routine.
6. Class methods are used for ___________ and the call starts with ____________.
One; zero to many
Action
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Interface; Implementation
7. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
NSArray; no - it's immutable.
NO is zero; YES is anything else.
Call setNeedsDisplay:
NSLog; %@; %d and other formatters
8. What is the makeup of a CGPoint?
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
NO is zero; YES is anything else.
NSDictionary; no - it's immutable.
Two CGFloats for x and y
9. All classes should have a __________________ to be called by subclasses.
Two CGFloats for x and y
My rectangle in my superview's coordinate space
The compiler adds code to count references.
Designated initializer.
10. What do I use for a hash table/associative array? And is it mutable?
11. How to see all actions - outlets - incoming/outgoing segues on a view?
Center of the frame - which is in the superview's coordinate system
Argument validation.
Right-click on view - or even a subview like a button.
Action
12. Can the controller talking to the view?
Yes. As much as it wants.
[Object isKindOfClass:[Classname class]]
The compiler adds code to count references.
Center of the frame - which is in the superview's coordinate system
13. ________ is the .h file and __________ is the .m file.
NSUserDefaults - which stores a property list.
NSObject
Never!
Interface; Implementation
14. How many superviews does a view have? How many subviews?
Other MVC trios.
A framework.
Introspection - with the class method 'class'
One; zero to many
15. The controller is always a subclass of...?
The runtime system asks the object what its class is.
UIViewController.
Instance method; class method.
NSUserDefaults - which stores a property list.
16. What is at the top of the view hierarchy?
Dash - Plus sign.
NSArray; no - it's immutable.
Never!
UIWindow
17. List the iOS hierarchy from top to bottom.
Cocoa Touch - Media - Core Services - Core OS
An outlet.
NSNumber. For example numberWithDouble: and doubleValue:
Interface; Implementation
18. A property is just the combination of _______.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Override drawRect:
Getter and setter methods.
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.
19. What do I use for a bag of bits?
NSData
Strong. Object memory is freed at the end of the routine.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
NSArray; no - it's immutable.
20. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Other MVC trios.
NSUserDefaults - which stores a property list.
Outlet; Action
Strong. Object memory is freed at the end of the routine.
21. Does a view 'own' the data it displays?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Lazy instantiation.
No - it gets the data from the controller.
Other MVC trios.
22. How to do enumeration with NSArray - NSDictionary - etc?
23. ________ implements the getter and setter. But we can always__________
Designated initializer.
@synthesize; write our own getter and/or setter.
Other MVC trios.
One; zero to many
24. 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.
No. It's fine.
NSNumber. For example numberWithDouble: and doubleValue:
[Object isMemberOfClass:[Classname class]]
25. Talk about BOOL variables.
zero/nil
Call setNeedsDisplay:
Override drawRect:
NO is zero; YES is anything else.
26. Is it always bad to send messages to id?
27. What is in the model?
Properties; instance variables
On left side - is calling the setter - and on the right side - is calling the getter.
The document; possibly a database.
To zero; so pointers are nil.
28. How to add subviews in code? How to remove them?
NSData
addSubview; removeFromSubview
create a model
Points - to achieve device-independence
29. What is the fundamental design pattern of iOS development?
id
MVC - for model-view-controller
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.
30. What is static typing? Why is it good?
31. How to tell if an object is of a particular 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.
@synthesize; write our own getter and/or setter.
Strong. Object memory is freed at the end of the routine.
[Object isMemberOfClass:[Classname class]]
32. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
33. There is no difference between _____ and _______ at runtime.
zero/nil
id; an object pointer
line up the colons!
(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.
34. What is the bounds property of a UIView?
Cocoa Touch - Media - Core Services - Core OS
UIViewController.
internal origin and size. Use this inside a view
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
35. How to force a redraw of a custom area?
the controller's minions. Gets things to the screen.
Call setNeedsDisplay:
In the getter! This is called lazy instantiation.
Cocoa Touch - Media - Core Services - Core OS
36. Calling a method on id works just fine because....?
To zero; so pointers are nil.
NSUserDefaults - which stores a property list.
The runtime system asks the object what its class is.
Can handle any language because it uses Unicode.
37. ______ is a pointer
self
UIWindow
Designated initializer.
create a model
38. Classes cannot have _________ or ___________.
zero/nil
One; zero to many
Properties; instance variables
Nothing happens - and nil is returned.
39. What to do in Xcode for short documentation? For full documentation?
A CGPoint and and a CGSize
[[UIView alloc] initWithFrame]
option-click; option-double-click
NSSet; no - it's immutable
40. What is the name of a property in the controller that it uses to talk to views?
'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.
The runtime system asks the object what its class is.
An outlet.
The compiler adds code to count references.
41. How are local variables initialized in iOS 5?
MVC - for model-view-controller
To zero; so pointers are nil.
NSObject
Introspection - with the class method 'class'
42. Talk about NSString
An outlet.
Can handle any language because it uses Unicode.
Lazy instantiation.
id; an object pointer
43. Some controllers have ____________ as their views.
the controller's minions. Gets things to the screen.
[Object isKindOfClass:[Classname class]]
Other MVC trios.
'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.
44. Remember that it's cool to...
for...in; don't change things inside the loop.
NSData
line up the colons!
addSubview; removeFromSubview
45. What does a view (UIView) represent?
id; an object pointer
UIWindow
[Class respondsToSelector:@selector(aMethod)]
A rectangular area
46. The setters for outlets are called by _______ at this point ______________.
Two CGFloats for x and y
iOS; when the view is loaded.
One; zero to many
[Object isMemberOfClass:[Classname class]]
47. What is a property list?
UIViewController.
The compiler adds code to count references.
'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.'
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
48. Instead of 'include' statements - in Objective-C we use _______ which does ________
Override drawRect:
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Import / handle multiple inclusion.
Nothing happens - and nil is returned.
49. What do I use for an ordered collection of objects? And is it mutable?
50. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
for...in; don't change things inside the loop.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Instance method; class method.
Properties; instance variables