SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
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. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Center of the frame - which is in the superview's coordinate system
Outlet; Action
for...in; don't change things inside the loop.
Instance variable (ivar) or 'backing variable'
2. How to add subviews in code? How to remove them?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
addSubview; removeFromSubview
Right-click on view - or even a subview like a button.
No. Use NSMutableArray - which is a subclass of NSArray.
3. Remember that it's cool to...
Import / handle multiple inclusion.
line up the colons!
Cocoa Touch - Media - Core Services - Core OS
Interface; Implementation
4. What does a view (UIView) represent?
A rectangular area
Override drawRect:
Controls how the model is presented onscreen.
option-click; option-double-click
5. When is it OK to call drawRect: directly?
internal origin and size. Use this inside a view
Never!
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
line up the colons!
6. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
[Object isKindOfClass:[Classname class]]
NSLog; %@; %d and other formatters
Points - to achieve device-independence
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
7. What about the model and the view talking to one another?
Never!
Lazy instantiation.
UIWindow
No. It's fine.
8. 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.
No. Use NSMutableArray - which is a subclass of NSArray.
Instance method; class method.
Interface; Implementation
9. Why are properties good?
Interface; Implementation
Dash - Plus sign.
(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.
self
10. What about controller talking to the model?
Can handle any language because it uses Unicode.
A CGPoint and and a CGSize
Strong. Object memory is freed at the end of the routine.
Yes. The controller knows everything about the model.
11. What is the center property of a UIView?
12. The decision on what method to call is made when?
NSLog; %@; %d and other formatters
Yes. As much as it wants.
At runtime.
Two floats - for width and height
13. The setters for outlets are called by _______ at this point ______________.
iOS; when the view is loaded.
A CGPoint and and a CGSize
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
14. How to tell whether an object implements a particular method? (A line of code)
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.
[Class respondsToSelector:@selector(aMethod)]
Center of the frame - which is in the superview's coordinate system
NSSet; no - it's immutable
15. How are local variables initialized in iOS 5?
zero/nil
To zero; so pointers are nil.
Outlet; Action
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
16. Does a view 'own' the data it displays?
Interface; Implementation
No. Use NSMutableArray - which is a subclass of NSArray.
No - it gets the data from the controller.
NSLog; %@; %d and other formatters
17. What is the makeup of a CGRect?
Two floats - for width and height
Getter and setter methods.
An outlet.
A CGPoint and and a CGSize
18. What about public/private in Objective-C?
19. What is in the model?
The compiler adds code to count references.
Two CGFloats for x and y
No...but it has 'a way' to notify the controller to come ask for fresh data.
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 ______________.
Interface; Implementation
Instance method; class method.
Outlet; Action
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.
21. In the initializer methods of objects I create - add what line of code? Why?
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.
NSArray; no - it's immutable.
Strong. Object memory is freed at the end of the routine.
self
22. What is static typing? Why is it good?
23. What does the controller do?
Class XX = [Object class]
iOS; when the view is loaded.
Controls how the model is presented onscreen.
Import / handle multiple inclusion.
24. What is an example of a reason to write a getter?
Lazy instantiation.
NO is zero; YES is anything else.
To zero; so pointers are nil.
Import / handle multiple inclusion.
25. Is NSArray mutable?
No. Use NSMutableArray - which is a subclass of NSArray.
Never!
MVC - for model-view-controller
Controls how the model is presented onscreen.
26. A property is just the combination of _______.
Getter and setter methods.
Action
Dash - Plus sign.
Override drawRect:
27. What is the fundamental design pattern of iOS development?
Strongly.
[Object isKindOfClass:[Classname class]]
Points - to achieve device-independence
MVC - for model-view-controller
28. All properties are initialized to _____
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
zero/nil
Instance variable (ivar) or 'backing variable'
Nothing happens - and nil is returned.
29. How to instantiate an object?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
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.
Lazy instantiation.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
30. What is the bounds property of a UIView?
NSObject
internal origin and size. Use this inside a view
Dash - Plus sign.
No. It's fine.
31. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
32. How to force a redraw of a custom area?
(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.
Call setNeedsDisplay:
option-click; option-double-click
zero/nil
33. What do I use for a hash table/associative array? And is it mutable?
34. In a nutshell: how to do custom drawing?
id
Override drawRect:
[Object isMemberOfClass:[Classname class]]
Two floats - for width and height
35. Classes cannot have _________ or ___________.
'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.'
Properties; instance variables
The runtime system asks the object what its class is.
Nothing happens - and nil is returned.
36. ________ is the .h file and __________ is the .m file.
A rectangular area
An outlet.
'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.
Interface; Implementation
37. The basic steps in custom drawing.
Strong. Object memory is freed at the end of the routine.
NO is zero; YES is anything else.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
'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.
38. Talk about NSString
NSData
Can handle any language because it uses Unicode.
Instance variable (ivar) or 'backing variable'
Controls how the model is presented onscreen.
39. Instance methods start with a ______ and class methods start with a ______.
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.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Action
Dash - Plus sign.
40. What does 'weak' mean?
41. What is the makeup of 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.
Two floats - for width and height
internal origin and size. Use this inside a view
Instance method; class method.
42. How to tell if an object is of a particular class? (Write a line of code)
the controller's minions. Gets things to the screen.
[Object isKindOfClass:[Classname class]]
NSLog; %@; %d and other formatters
[Object isMemberOfClass:[Classname class]]
43. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
44. The view is...
45. Can the controller talking to the view?
Yes. As much as it wants.
'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.
internal origin and size. Use this inside a view
@synthesize; write our own getter and/or setter.
46. How about the model talking to the controller?
47. All classes should have a __________________ to be called by subclasses.
The runtime system asks the object what its class is.
Points - to achieve device-independence
Designated initializer.
Never!
48. What if I want to put a scalar into an NSArray or NSSet?
Yes. The controller knows everything about the model.
Wrap it in NSValue. And remember that NSValue immutable.
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.
A framework.
49. Objects in an array: are the pointed to strongly or weakly?
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.
Strongly.
Cocoa Touch - Media - Core Services - Core OS
for...in; don't change things inside the loop.
50. What is at the top of the view hierarchy?
UIWindow
My rectangle in my superview's coordinate space
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.
[Class respondsToSelector:@selector(aMethod)]