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. All properties are initialized to _____
zero/nil
the controller's minions. Gets things to the screen.
Never!
Override drawRect:
2. How to add subviews in code? How to remove them?
addSubview; removeFromSubview
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
line up the colons!
Outlet; Action
3. Dot notation does what?
Two CGFloats for x and y
On left side - is calling the setter - and on the right side - is calling the getter.
A framework.
Cocoa Touch - Media - Core Services - Core OS
4. What is the name of a property in the controller that it uses to talk to views?
At runtime.
The compiler adds code to count references.
An outlet.
A rectangular area
5. What about the model and the view talking to one another?
Cocoa Touch - Media - Core Services - Core OS
Never!
NSUserDefaults - which stores a property list.
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.
6. In a nutshell: how to do custom drawing?
Override drawRect:
Yes. As much as it wants.
Nothing happens - and nil is returned.
Points - to achieve device-independence
7. Can the controller talking to the view?
option-click; option-double-click
id; an object pointer
Yes. As much as it wants.
Wrap it in NSValue. And remember that NSValue immutable.
8. What about controller talking to the model?
Yes. The controller knows everything about the model.
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.
[[UIView alloc] initWithFrame]
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
9. Remember that it's cool to...
Dash - Plus sign.
Getter and setter methods.
NSSet; no - it's immutable
line up the colons!
10. What is at the top of the view hierarchy?
UIWindow
self
internal origin and size. Use this inside a view
To zero; so pointers are nil.
11. ______ is a pointer to any object.
Call setNeedsDisplay:
Center of the frame - which is in the superview's coordinate system
id
line up the colons!
12. You can send a message to a...
self
Cocoa Touch - Media - Core Services - Core OS
constant NSString
No. Use NSMutableArray - which is a subclass of NSArray.
13. What about the view talking to the controller?
14. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
The document; possibly a database.
Instance method; class method.
NSObject
Two floats - for width and height
15. 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.
A framework.
Wrap it in NSValue. And remember that NSValue immutable.
NO is zero; YES is anything else.
16. How many superviews does a view have? How many subviews?
Argument validation.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
One; zero to many
Strong. Object memory is freed at the end of the routine.
17. Talk about BOOL variables.
Cocoa Touch - Media - Core Services - Core OS
MVC - for model-view-controller
NO is zero; YES is anything else.
Wrap it in NSValue. And remember that NSValue immutable.
18. What if I want to put a scalar into an NSArray or NSSet?
Wrap it in NSValue. And remember that NSValue immutable.
'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.
id
At runtime.
19. What is a property list?
Override drawRect:
Never!
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
the controller's minions. Gets things to the screen.
20. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
21. What about public/private in Objective-C?
22. What is the bounds property of a UIView?
The compiler adds code to count references.
Wrap it in NSValue. And remember that NSValue immutable.
My rectangle in my superview's coordinate space
internal origin and size. Use this inside a view
23. What is the iOS term for a library?
'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.'
Controls how the model is presented onscreen.
Yes. As much as it wants.
A framework.
24. Why are properties good?
(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.
NSArray; no - it's 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.
Designated initializer.
25. ________ is the .h file and __________ is the .m file.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
option-click; option-double-click
Two CGFloats for x and y
Interface; Implementation
26. The controller is always a subclass of...?
UIViewController.
Action
Two floats - for width and height
Argument validation.
27. What does 'strong' mean?
28. When is it OK to call drawRect: directly?
Never!
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.
id; an object pointer
Properties; instance variables
29. How to force a redraw of a custom area?
Instance variable (ivar) or 'backing variable'
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
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.
Call setNeedsDisplay:
30. What is the base class for most objects in the iOS SDK?
option-click; option-double-click
addSubview; removeFromSubview
NSObject
create a model
31. Instance methods start with a ______ and class methods start with a ______.
Controls how the model is presented onscreen.
Dash - Plus sign.
Properties; instance variables
Center of the frame - which is in the superview's coordinate system
32. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
Two floats - for width and height
id
option-click; option-double-click
[Object isKindOfClass:[Classname class]]
33. ________ implements the getter and setter. But we can always__________
NSLog; %@; %d and other formatters
@synthesize; write our own getter and/or setter.
[Class respondsToSelector:@selector(aMethod)]
To zero; so pointers are nil.
34. Show a private interface section.
NSSet; no - it's immutable
id; an object pointer
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
The compiler adds code to count references.
35. Where do I initialize properties?
Outlet; Action
No. Use NSMutableArray - which is a subclass of NSArray.
In the getter! This is called lazy instantiation.
internal origin and size. Use this inside a view
36. Does a view 'own' the data it displays?
The document; possibly a database.
UIViewController.
NSData
No - it gets the data from the controller.
37. What is the frame property of a UIView?
38. Are local pointers to objects strong or weak? So what happens at the end of the routine?
Lazy instantiation.
Strong. Object memory is freed at the end of the routine.
Strongly.
NSDictionary; no - it's immutable.
39. What is the center property of a UIView?
40. All classes should have a __________________ to be called by subclasses.
NO is zero; YES is anything else.
Designated initializer.
Yes. The controller knows everything about the model.
Two floats - for width and height
41. What to do in Xcode for short documentation? For full documentation?
Instance variable (ivar) or 'backing variable'
id
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.
42. What do I use for a hash table/associative array? And is it mutable?
43. There is no difference between _____ and _______ at runtime.
[Object isMemberOfClass:[Classname class]]
id; an object pointer
id
'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. What is in the model?
Cocoa Touch - Media - Core Services - Core OS
In the getter! This is called lazy instantiation.
internal origin and size. Use this inside a view
The document; possibly a database.
45. Is it always bad to send messages to id?
46. Is NSArray mutable?
Call setNeedsDisplay:
No. Use NSMutableArray - which is a subclass of NSArray.
Class XX = [Object class]
Never!
47. When happens when you send a message to nil?
Strong. Object memory is freed at the end of the routine.
NSSet; no - it's immutable
Getter and setter methods.
Nothing happens - and nil is returned.
48. ______ is a pointer
Two CGFloats for x and y
self
Can handle any language because it uses Unicode.
[Object isKindOfClass:[Classname class]]
49. What do I use for a bag of bits?
NSData
self.view
NSObject
Instance method; class method.
50. What is a reason to write our own setter?
No - it gets the data from the controller.
Argument validation.
Strong. Object memory is freed at the end of the routine.
Action