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. Does a view 'own' the data it displays?
Never!
No - it gets the data from the controller.
Strong. Object memory is freed at the end of the routine.
A CGPoint and and a CGSize
2. What is the center property of a UIView?
3. All classes should have a __________________ to be called by subclasses.
Designated initializer.
Action
Call setNeedsDisplay:
the controller's minions. Gets things to the screen.
4. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
5. What is the fundamental design pattern of iOS development?
NSObject
Import / handle multiple inclusion.
MVC - for model-view-controller
No...but it has 'a way' to notify the controller to come ask for fresh data.
6. The controller is always a subclass of...?
Nothing happens - and nil is returned.
NSUserDefaults - which stores a property list.
UIViewController.
A framework.
7. Talk about NSString
Yes. As much as it wants.
@synthesize; write our own getter and/or setter.
Can handle any language because it uses Unicode.
No. It's fine.
8. What is the base class for most objects in the iOS SDK?
NSObject
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.
On left side - is calling the setter - and on the right side - is calling the getter.
No - it gets the data from the controller.
9. How to instantiate an object?
At runtime.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Wrap it in NSValue. And remember that NSValue immutable.
One; zero to many
10. What about the model and the view talking to one another?
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.
'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.'
Yes. The controller knows everything about the model.
Never!
11. The setters for outlets are called by _______ at this point ______________.
Controls how the model is presented onscreen.
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.
iOS; when the view is loaded.
id; an object pointer
12. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
13. How to tell whether an object implements a particular method? (A line of code)
[Class respondsToSelector:@selector(aMethod)]
No. It's fine.
zero/nil
In the getter! This is called lazy instantiation.
14. How can I find out the class of any object? Give a line of code.
Class XX = [Object class]
No. It's fine.
Dash - Plus sign.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
15. Why are properties good?
No - it gets the data from the controller.
[Object isMemberOfClass:[Classname class]]
(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.
Properties; instance variables
16. How to do enumeration with NSArray - NSDictionary - etc?
17. What is the bounds property of a UIView?
In the getter! This is called lazy instantiation.
NSLog; %@; %d and other formatters
internal origin and size. Use this inside a view
Call setNeedsDisplay:
18. Is NSString mutable or not?
internal origin and size. Use this inside a view
Points - to achieve device-independence
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
NSNumber. For example numberWithDouble: and doubleValue:
19. How about the model talking to the controller?
20. List the iOS hierarchy from top to bottom.
Cocoa Touch - Media - Core Services - Core OS
the controller's minions. Gets things to the screen.
Call setNeedsDisplay:
Introspection - with the class method 'class'
21. How to force a redraw of a custom area?
Dash - Plus sign.
Nothing happens - and nil is returned.
Right-click on view - or even a subview like a button.
Call setNeedsDisplay:
22. If I need to convert a number to an object - use __________
Two floats - for width and height
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
NSNumber. For example numberWithDouble: and doubleValue:
the controller's minions. Gets things to the screen.
23. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
To zero; so pointers are nil.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
[Object isKindOfClass:[Classname class]]
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
24. What does 'strong' mean?
25. What is a reason to write our own setter?
Argument validation.
A framework.
self
NSObject
26. There is no difference between _____ and _______ at runtime.
A rectangular area
id; an object pointer
Controls how the model is presented onscreen.
Interface; Implementation
27. What is the makeup of a CGSize?
No - it gets the data from the controller.
UIViewController.
NSArray; no - it's immutable.
Two floats - for width and height
28. Show a private interface section.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
A CGPoint and and a CGSize
Properties; instance variables
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
29. What about the view talking to the controller?
30. What is used in lieu of pixels? And why?
internal origin and size. Use this inside a view
option-click; option-double-click
Points - to achieve device-independence
Controls how the model is presented onscreen.
31. What about controller talking to the model?
Getter and setter methods.
(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.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Yes. The controller knows everything about the model.
32. Instance methods start with a ______ and class methods start with a ______.
Yes. As much as it wants.
id; an object pointer
Call setNeedsDisplay:
Dash - Plus sign.
33. What is the makeup of a CGPoint?
[Object isMemberOfClass:[Classname class]]
Two CGFloats for x and y
Class XX = [Object class]
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
34. Is it always bad to send messages to id?
35. What do I use for an ordered collection of objects? And is it mutable?
36. Are local pointers to objects strong or weak? So what happens at the end of the routine?
Dash - Plus sign.
Strong. Object memory is freed at the end of the routine.
NSObject
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.
37. When happens when you send a message to nil?
Nothing happens - and nil is returned.
Override drawRect:
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Wrap it in NSValue. And remember that NSValue immutable.
38. When is it OK to call drawRect: directly?
MVC - for model-view-controller
NSObject
Never!
Action
39. Is NSArray mutable?
The document; possibly a database.
Yes. As much as it wants.
No. Use NSMutableArray - which is a subclass of NSArray.
Two CGFloats for x and y
40. How are local variables initialized in iOS 5?
To zero; so pointers are nil.
line up the colons!
Wrap it in NSValue. And remember that NSValue immutable.
UIWindow
41. All properties are initialized to _____
A framework.
Argument validation.
zero/nil
No - it gets the data from the controller.
42. How to add subviews in code? How to remove them?
NSNumber. For example numberWithDouble: and doubleValue:
No. Use NSMutableArray - which is a subclass of NSArray.
addSubview; removeFromSubview
id; an object pointer
43. What is the makeup of a CGRect?
for...in; don't change things inside the loop.
line up the colons!
NSData
A CGPoint and and a CGSize
44. What do I use for a hash table/associative array? And is it mutable?
45. What do I use for a bag of bits?
Instance method; class method.
Wrap it in NSValue. And remember that NSValue immutable.
NSData
(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.
46. ______ is a pointer to any object.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
id
NSNumber. For example numberWithDouble: and doubleValue:
the controller's minions. Gets things to the screen.
47. What to do in Xcode for short documentation? For full documentation?
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.
Instance variable (ivar) or 'backing variable'
option-click; option-double-click
Right-click on view - or even a subview like a button.
48. Classes cannot have _________ or ___________.
Getter and setter methods.
id
Properties; instance variables
NSNumber. For example numberWithDouble: and doubleValue:
49. The view is...
50. What is static typing? Why is it good?